Skip to content

Commit 4d44e99

Browse files
committed
FEAT: when $SHELL is not set on POSIX OS, /bin/sh is used as a default
Such a situation may happen for example on a clean Alpine Docker's image.
1 parent be2463a commit 4d44e99

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/os/posix/host-lib.c

+1-5
Original file line numberDiff line numberDiff line change
@@ -982,11 +982,7 @@ static inline REBOOL Open_Pipe_Fails(int pipefd[2]) {
982982
const char ** argv_new = NULL;
983983
sh = getenv("SHELL");
984984
if (sh == NULL) {
985-
int err = 2; /* shell does not exist */
986-
if(write(info_pipe[W], &err, sizeof(err)) == -1) {
987-
//nothing there... just to avoid "unused-result" compiler warning
988-
}
989-
exit(EXIT_FAILURE);
985+
sh = "/bin/sh"; // if $SHELL is not defined
990986
}
991987
argv_new = OS_Make((argc + 3) * sizeof(char*));
992988
argv_new[0] = sh;

0 commit comments

Comments
 (0)