From 07a6b56636f0909e3e8ffab064b0ebc3ad5929a3 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Mon, 14 Jan 2008 12:59:24 +0000 Subject: [PATCH] system() works correctly, so we can use its return value now. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23515 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/terminal/Shell.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/apps/terminal/Shell.cpp b/src/apps/terminal/Shell.cpp index cff72af10e..d40903a230 100644 --- a/src/apps/terminal/Shell.cpp +++ b/src/apps/terminal/Shell.cpp @@ -277,7 +277,7 @@ Shell::_Spawn(int row, int col, const char *encoding, int argc, const char **arg /* * Get a pseudo-tty. We do this by cycling through files in the - * directory. The operationg system will not allow us to open a master + * directory. The operating system will not allow us to open a master * which is already in use, so we simply go until the open succeeds. */ char ttyName[B_PATH_NAME_LENGTH]; @@ -488,17 +488,15 @@ Shell::_Spawn(int row, int col, const char *encoding, int argc, const char **arg * Exec failed. */ sleep(1); - /*const char *spawnAlertMessage = "alert --stop " + const char *spawnAlertMessage = "alert --stop " "'Cannot execute \"%s\":\n" "\t%s' " "'Use Default Shell' 'Abort'"; char errorMessage[256]; - snprintf(errorMessage, sizeof(errorMessage), spawnAlertMessage, commandLine, strerror(errno)); + snprintf(errorMessage, sizeof(errorMessage), spawnAlertMessage, *argv, strerror(errno)); - // TODO: I'm not sure that system should return the return value of alert. - // At least, it's not doing that right now. int returnValue = system(errorMessage); - if (returnValue == 0)*/ + if (returnValue == 0) execl("/bin/sh", "/bin/sh", "-login", NULL); exit(1);