aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhenlei Huang <zlei@FreeBSD.org>2025-09-10 04:00:05 +0000
committerZhenlei Huang <zlei@FreeBSD.org>2025-09-10 04:00:05 +0000
commit685e60e860d61f6e1bcf981f5c30647e0c025702 (patch)
tree0b361ac625948d01509fcc14f71986c7df6a19f5
parent90593b1bdb80a41b499b47437b4f545c24666b2d (diff)
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
-rw-r--r--usr.sbin/ngctl/main.c4
1 files changed, 4 insertions, 0 deletions
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)