From 2546c543fd7955276388aae6f0869d2c9285ba59 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Sat, 17 Feb 2024 21:30:48 -0700 Subject: [PATCH] reboot: Move extern for environ envorin isn't defined in any header, and gcc is cranky with this inside a function, so move it to global scope. Both clang and gcc are now happy with this. Sponsored by: Netflix --- sbin/reboot/reboot.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sbin/reboot/reboot.c b/sbin/reboot/reboot.c index 550530ad079e..d215255487a7 100644 --- a/sbin/reboot/reboot.c +++ b/sbin/reboot/reboot.c @@ -51,6 +51,8 @@ #include #include +extern char **environ; + #define PATH_NEXTBOOT "/boot/nextboot.conf" static void usage(void) __dead2; @@ -84,7 +86,6 @@ zfsbootcfg(const char *pool, bool force) }; int rv, status; pid_t p; - extern char **environ; rv = posix_spawnp(&p, av[0], NULL, NULL, __DECONST(char **, av), environ);