X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a83f860948059b0273b5cc6d9e43fadad3ebfca..75504144d2ee5ce2bc62d186f04b2d445c2048c5:/src/unix/utilsunx.cpp diff --git a/src/unix/utilsunx.cpp b/src/unix/utilsunx.cpp index 7394cc50e6..219c7727cb 100644 --- a/src/unix/utilsunx.cpp +++ b/src/unix/utilsunx.cpp @@ -880,9 +880,9 @@ wxLinuxDistributionInfo wxGetLinuxDistributionInfo() const wxString desc = wxGetCommandOutput(wxT("lsb_release --description")); const wxString rel = wxGetCommandOutput(wxT("lsb_release --release")); const wxString codename = wxGetCommandOutput(wxT("lsb_release --codename")); - + wxLinuxDistributionInfo ret; - + id.StartsWith("Distributor ID:\t", &ret.Id); desc.StartsWith("Description:\t", &ret.Description); rel.StartsWith("Release:\t", &ret.Release); @@ -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; @@ -1412,7 +1418,7 @@ int wxAppTraits::WaitForChild(wxExecuteData& execData) } //else: synchronous execution case -#if HAS_PIPE_INPUT_STREAM +#if HAS_PIPE_INPUT_STREAM && wxUSE_SOCKETS wxProcess * const process = execData.process; if ( process && process->IsRedirected() ) {