about summary refs log tree commit diff
path: root/sysdeps/posix/system.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/posix/system.c')
-rw-r--r--sysdeps/posix/system.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sysdeps/posix/system.c b/sysdeps/posix/system.c
index e53ec5f977..13c0662f90 100644
--- a/sysdeps/posix/system.c
+++ b/sysdeps/posix/system.c
@@ -175,6 +175,10 @@ do_system (const char *line)
       __libc_cleanup_region_end (0);
 #endif
     }
+  else
+   /* POSIX states that failure to execute the shell should return
+      as if the shell had terminated using _exit(127).  */
+   status = W_EXITCODE (127, 0);
 
   DO_LOCK ();
   if (SUB_REF () == 0)