Mercurial > octave-nkf
comparison libinterp/interpfcn/toplev.cc @ 15756:ea1a1fb00744
Make the path to the shell interpreter configuable
* configure.ac: Add --with-shell option and define SHELL_PATH.
* libinterp/interp-core/oct-procbuf.cc (octave_procbuf::open),
libinterp/interpfcn/toplev.cc (Fsystem): Use it.
author | Mike Miller <mtmiller@ieee.org> |
---|---|
date | Sat, 08 Dec 2012 16:08:09 -0500 |
parents | 5f031158c693 |
children | 5b2126a8c84f |
comparison
equal
deleted
inserted
replaced
15755:3216dafbbd48 | 15756:ea1a1fb00744 |
---|---|
75 #include "unwind-prot.h" | 75 #include "unwind-prot.h" |
76 #include "utils.h" | 76 #include "utils.h" |
77 #include "variables.h" | 77 #include "variables.h" |
78 #include "version.h" | 78 #include "version.h" |
79 | 79 |
80 #ifndef SHELL_PATH | |
81 #define SHELL_PATH "/bin/sh" | |
82 #endif | |
83 | |
80 void (*octave_exit) (int) = ::exit; | 84 void (*octave_exit) (int) = ::exit; |
81 | 85 |
82 // TRUE means the quit() call is allowed. | 86 // TRUE means the quit() call is allowed. |
83 bool quit_allowed = true; | 87 bool quit_allowed = true; |
84 | 88 |
948 else if (pid == 0) | 952 else if (pid == 0) |
949 { | 953 { |
950 // FIXME -- should probably replace this | 954 // FIXME -- should probably replace this |
951 // call with something portable. | 955 // call with something portable. |
952 | 956 |
953 execl ("/bin/sh", "sh", "-c", cmd_str.c_str (), | 957 execl (SHELL_PATH, "sh", "-c", cmd_str.c_str (), |
954 static_cast<void *> (0)); | 958 static_cast<void *> (0)); |
955 | 959 |
956 panic_impossible (); | 960 panic_impossible (); |
957 } | 961 } |
958 else | 962 else |