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
This commit is contained in:
Warner Losh 2024-02-17 21:30:48 -07:00
parent 4d0be3986c
commit 2546c543fd

View file

@ -51,6 +51,8 @@
#include <unistd.h>
#include <utmpx.h>
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);