diff options
author | kensmith <kensmith@FreeBSD.org> | 2005-08-05 13:39:08 +0000 |
---|---|---|
committer | kensmith <kensmith@FreeBSD.org> | 2005-08-05 13:39:08 +0000 |
commit | 58bf7b9f04aa7f5e18578a64d88f26f8a8826c63 (patch) | |
tree | 7f5abd37187a55e9f4fd51350681709ba5b4afc1 | |
parent | b9184129f88c2735a10aaccd9f7a098c410ee7e4 (diff) | |
download | FreeBSD-src-58bf7b9f04aa7f5e18578a64d88f26f8a8826c63.zip FreeBSD-src-58bf7b9f04aa7f5e18578a64d88f26f8a8826c63.tar.gz |
The /stand directory now disappears out from under sysinstall while
it is running during installations. The vsystem() function does get
used after this happens (e.g. if you manually configure the network
interface and ask it to enable the interface) so it needs to be a
little smarter about whether it uses /stand/sh or /bin/sh.
MFC after: 3 days
-rw-r--r-- | usr.sbin/sade/system.c | 3 | ||||
-rw-r--r-- | usr.sbin/sysinstall/system.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/sade/system.c b/usr.sbin/sade/system.c index ac453ea..00abb4e 100644 --- a/usr.sbin/sade/system.c +++ b/usr.sbin/sade/system.c @@ -408,6 +408,7 @@ vsystem(char *fmt, ...) sig_t intsave, quitsave; char *cmd; int i; + struct stat sb; cmd = (char *)alloca(FILENAME_MAX); cmd[0] = '\0'; @@ -438,7 +439,7 @@ vsystem(char *fmt, ...) close(1); open("/dev/null", O_WRONLY); dup2(1, 2); } - if (RunningAsInit) + if (stat("/stand/sh", &sb) == 0) execl("/stand/sh", "/stand/sh", "-c", cmd, (char *)NULL); else execl("/bin/sh", "/bin/sh", "-c", cmd, (char *)NULL); diff --git a/usr.sbin/sysinstall/system.c b/usr.sbin/sysinstall/system.c index ac453ea..00abb4e 100644 --- a/usr.sbin/sysinstall/system.c +++ b/usr.sbin/sysinstall/system.c @@ -408,6 +408,7 @@ vsystem(char *fmt, ...) sig_t intsave, quitsave; char *cmd; int i; + struct stat sb; cmd = (char *)alloca(FILENAME_MAX); cmd[0] = '\0'; @@ -438,7 +439,7 @@ vsystem(char *fmt, ...) close(1); open("/dev/null", O_WRONLY); dup2(1, 2); } - if (RunningAsInit) + if (stat("/stand/sh", &sb) == 0) execl("/stand/sh", "/stand/sh", "-c", cmd, (char *)NULL); else execl("/bin/sh", "/bin/sh", "-c", cmd, (char *)NULL); |