Mirror of GNU Guix
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
1.0 KiB

  1. We want to allow builds in chroots that lack /bin/sh. Thus, system(3)
  2. and popen(3) need to be tweaked to use the right shell. For the bootstrap
  3. glibc, we just use whatever `sh' can be found in $PATH. The final glibc
  4. instead uses the hard-coded absolute file name of `bash'.
  5. --- a/sysdeps/posix/system.c
  6. +++ b/sysdeps/posix/system.c
  7. @@ -106,8 +106,8 @@ do_system (const char *line)
  8. (void) UNBLOCK;
  9. /* Exec the shell. */
  10. - (void) __execve (SHELL_PATH, (char *const *) new_argv, __environ);
  11. + (void) execvp (SHELL_NAME, (char *const *) new_argv);
  12. _exit (127);
  13. }
  14. else if (pid < (pid_t) 0)
  15. /* The fork failed. */
  16. --- a/libio/iopopen.c
  17. +++ b/libio/iopopen.c
  18. @@ -170,7 +170,7 @@ _IO_new_proc_open (fp, command, mode)
  19. for (p = proc_file_chain; p; p = p->next)
  20. _IO_close (_IO_fileno ((_IO_FILE *) p));
  21. - _IO_execl ("/bin/sh", "sh", "-c", command, (char *) 0);
  22. + execlp ("sh", "sh", "-c", command, (char *) 0);
  23. _IO__exit (127);
  24. }
  25. _IO_close (child_end);