diff options
Diffstat (limited to 'util/fbrun')
-rw-r--r-- | util/fbrun/FbRun.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/util/fbrun/FbRun.cc b/util/fbrun/FbRun.cc index 7797f76..95cb94d 100644 --- a/util/fbrun/FbRun.cc +++ b/util/fbrun/FbRun.cc | |||
@@ -119,8 +119,15 @@ void FbRun::run(const std::string &command) { | |||
119 | 119 | ||
120 | // fork and execute program | 120 | // fork and execute program |
121 | if (!fork()) { | 121 | if (!fork()) { |
122 | |||
123 | char *shell = getenv("SHELL"); | ||
124 | if (!shell) | ||
125 | shell = "/bin/sh"; | ||
126 | |||
127 | std::string exec_cmd = "exec " + command; | ||
128 | |||
122 | setsid(); | 129 | setsid(); |
123 | execl("/bin/sh", "/bin/sh", "-c", command.c_str(), static_cast<void*>(NULL)); | 130 | execl(shell, shell, "-c", exec_cmd.c_str(), static_cast<void*>(NULL)); |
124 | exit(0); //exit child | 131 | exit(0); //exit child |
125 | } | 132 | } |
126 | 133 | ||