]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/utilsunx.cpp
Move SendTextUpdatedEvent() down to wxTextEntryBase from wxTextCtrlBase.
[wxWidgets.git] / src / unix / utilsunx.cpp
index 2e9973b6da81370f3a26771f0e860aab904f1b64..219c7727cbb8da1d2c9ce6581c7611dd63927411 100644 (file)
@@ -1373,15 +1373,21 @@ int DoWaitForChild(int pid, int flags = 0)
     {
         wxASSERT_MSG( rc == pid, "unexpected waitpid() return value" );
 
+        // notice that the caller expects the exit code to be signed, e.g. -1
+        // instead of 255 so don't assign WEXITSTATUS() to an int
+        signed char exitcode;
         if ( WIFEXITED(status) )
-            return WEXITSTATUS(status);
+            exitcode = WEXITSTATUS(status);
         else if ( WIFSIGNALED(status) )
-            return -WTERMSIG(status);
+            exitcode = -WTERMSIG(status);
         else
         {
             wxLogError("Child process (PID %d) exited for unknown reason, "
                        "status = %d", pid, status);
+            exitcode = -1;
         }
+
+        return exitcode;
     }
 
     return -1;