The branch main has been updated by zlei:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=685e60e860d61f6e1bcf981f5c30647e0c025702

commit 685e60e860d61f6e1bcf981f5c30647e0c025702
Author:     Zhenlei Huang <z...@freebsd.org>
AuthorDate: 2025-09-10 04:00:05 +0000
Commit:     Zhenlei Huang <z...@freebsd.org>
CommitDate: 2025-09-10 04:00:05 +0000

    ngctl: Fix build without JAIL
    
    Reported by:    Michael Dexter
    Fixes:          72d01e62b082 netgraph: teach ngctl to attach and run itself 
in a jail
    MFC after:      1 day
---
 usr.sbin/ngctl/main.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/usr.sbin/ngctl/main.c b/usr.sbin/ngctl/main.c
index b32e4f878b6e..b86f1ca27e71 100644
--- a/usr.sbin/ngctl/main.c
+++ b/usr.sbin/ngctl/main.c
@@ -144,7 +144,9 @@ main(int ac, char *av[])
        char            name[NG_NODESIZ];
        int             interactive = isatty(0) && isatty(1);
        FILE            *fp = NULL;
+#ifdef JAIL
        const char      *jail_name = NULL;
+#endif
        int             ch, rtn = 0;
 
        /* Set default node name */
@@ -181,6 +183,7 @@ main(int ac, char *av[])
        ac -= optind;
        av += optind;
 
+#ifdef JAIL
        if (jail_name != NULL) {
                int jid;
 
@@ -196,6 +199,7 @@ main(int ac, char *av[])
                        errx((errno == EPERM) ? EX_NOPERM : EX_OSERR,
                            "cannot attach to jail");
        }
+#endif
 
        /* Create a new socket node */
        if (NgMkSockNode(name, &csock, &dsock) < 0)

Reply via email to