pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/sysutils/lsof/files



Module Name:    pkgsrc
Committed By:   tron
Date:           Mon Dec 18 17:17:33 UTC 2023

Modified Files:
        pkgsrc/sysutils/lsof/files: rnmt.c

Log Message:
lsof: Fix build under NetBSD-current (10.99.x)

Get "lsof" to build after NetBSD-current's name cache changes


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 pkgsrc/sysutils/lsof/files/rnmt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/sysutils/lsof/files/rnmt.c
diff -u pkgsrc/sysutils/lsof/files/rnmt.c:1.4 pkgsrc/sysutils/lsof/files/rnmt.c:1.5
--- pkgsrc/sysutils/lsof/files/rnmt.c:1.4       Wed May 25 10:02:27 2022
+++ pkgsrc/sysutils/lsof/files/rnmt.c   Mon Dec 18 17:17:33 2023
@@ -40,6 +40,10 @@ struct lnc {
        char lnc_name[NCHNAMLEN + 1];   /* name */
 };
 
+#ifndef NC_NLEN
+#define        NC_NLEN(ncp)    ((ncp)->nc_nlen)
+#endif
+
 static const rb_tree_ops_t lnc_rbtree_ops = {
        .rbto_compare_nodes = lnc_compare_nodes,
        .rbto_compare_key = lnc_compare_key,
@@ -90,7 +94,7 @@ ncache_enter_local(KA_T vp, const struct
        }
        lnc->lnc_vp = vp;
        lnc->lnc_plnc = plnc;
-       lnc->lnc_nlen = nc->nc_nlen;
+       lnc->lnc_nlen = NC_NLEN(nc);
        memcpy(lnc->lnc_name, nc->nc_name, lnc->lnc_nlen);
        lnc->lnc_name[lnc->lnc_nlen] = 0;
 
@@ -114,13 +118,13 @@ sanity_check_namecache(const struct name
        if (nc->nc_vp == NULL)
                return -1;
 
-       if (nc->nc_nlen > NCHNAMLEN)
+       if (NC_NLEN(nc) > NCHNAMLEN)
                return -1;
 
-       if (nc->nc_nlen == 1 && nc->nc_name[0] == '.')
+       if (NC_NLEN(nc) == 1 && nc->nc_name[0] == '.')
                return -1;
 
-       if (nc->nc_nlen == 2 && nc->nc_name[0] == '.' && nc->nc_name[1] == '.')
+       if (NC_NLEN(nc) == 2 && nc->nc_name[0] == '.' && nc->nc_name[1] == '.')
                return -1;
 
        return 0;



Home | Main Index | Thread Index | Old Index