foxygit / doom Log in
commit e81acc7df5f7939d93c6724e422f823111dfeba0
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Fri Dec 18 21:10:35 2009 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Fri Dec 18 21:10:35 2009 +0000

    Make ExecuteCommand() under Unix return a failure when the executable
    cannot be executed.

    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 1748
---
 setup/execute.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/setup/execute.c b/setup/execute.c
index 59f561be..8e753f60 100644
--- a/setup/execute.c
+++ b/setup/execute.c
@@ -312,7 +312,7 @@ static int ExecuteCommand(const char *program, const char *arg)

         execvp(argv[0], (char **) argv);

-        exit(-1);
+        exit(0x80);
     }
     else
     {
@@ -321,7 +321,7 @@ static int ExecuteCommand(const char *program, const char *arg)

         waitpid(childpid, &result, 0);

-        if (WIFEXITED(result))
+        if (WIFEXITED(result) && WEXITSTATUS(result) != 0x80)
         {
             return WEXITSTATUS(result);
         }