aboutsummaryrefslogtreecommitdiff
path: root/src/main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cc')
-rw-r--r--src/main.cc18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/main.cc b/src/main.cc
index 2d1ff0d..4554123 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -321,14 +321,16 @@ int main(int argc, char **argv) {
321 FbTk::FbStringUtil::shutdown(); 321 FbTk::FbStringUtil::shutdown();
322 322
323 if (restarting) { 323 if (restarting) {
324 const char *shell = getenv("SHELL"); 324 if (!restart_argument.empty()) {
325 if (!shell) 325 const char *shell = getenv("SHELL");
326 shell = "/bin/sh"; 326 if (!shell)
327 327 shell = "/bin/sh";
328 const char *arg = restart_argument.c_str(); 328
329 if (arg) { 329 const char *arg = restart_argument.c_str();
330 execlp(shell, shell, "-c", arg, (char *) NULL); 330 if (arg) {
331 perror(arg); 331 execlp(shell, shell, "-c", arg, (const char *) NULL);
332 perror(arg);
333 }
332 } 334 }
333 335
334 // fall back in case the above execlp doesn't work 336 // fall back in case the above execlp doesn't work