aboutsummaryrefslogtreecommitdiff
path: root/libbb/vfork_daemon_rexec.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/vfork_daemon_rexec.c')
-rw-r--r--libbb/vfork_daemon_rexec.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libbb/vfork_daemon_rexec.c b/libbb/vfork_daemon_rexec.c
index 89ae9a73c..ec8b9b1d7 100644
--- a/libbb/vfork_daemon_rexec.c
+++ b/libbb/vfork_daemon_rexec.c
@@ -40,11 +40,14 @@ pid_t spawn(char **argv)
40 * (but don't run atexit() stuff, which would screw up parent.) 40 * (but don't run atexit() stuff, which would screw up parent.)
41 */ 41 */
42 failed = errno; 42 failed = errno;
43 _exit(0); 43 _exit(111);
44 } 44 }
45 /* parent */ 45 /* parent */
46 /* Unfortunately, this is not reliable: vfork() 46 /* Unfortunately, this is not reliable: according to standards
47 * can be equivalent to fork() according to standards */ 47 * vfork() can be equivalent to fork() and we won't see value
48 * of 'failed'.
49 * Interested party can wait on pid and learn exit code.
50 * If 111 - then it (most probably) failed to exec */
48 if (failed) { 51 if (failed) {
49 errno = failed; 52 errno = failed;
50 return -1; 53 return -1;