Skip to content

Commit ee3e46e

Browse files
author
Robert Strong
committed
Bug 1524366 - Revert the Linux staging code changed in bug 1524366 to fix crash [@ mozilla::ipc::MessageChannel::Close()]. r=mhowell
1 parent acf6d68 commit ee3e46e

File tree

2 files changed

+3
-27
lines changed

2 files changed

+3
-27
lines changed

toolkit/xre/nsUpdateDriver.cpp

+2-26
Original file line numberDiff line numberDiff line change
@@ -636,13 +636,8 @@ static void ApplyUpdate(nsIFile *greDir, nsIFile *updateDir, nsIFile *appDir,
636636
// execv on Windows.
637637
if (restart) {
638638
exit(execv(updaterPath.get(), argv));
639-
}
640-
*outpid = fork();
641-
if (*outpid == -1) {
642-
delete[] argv;
643-
return;
644-
} else if (*outpid == 0) {
645-
exit(execv(updaterPath.get(), argv));
639+
} else {
640+
*outpid = PR_CreateProcess(updaterPath.get(), argv, nullptr, nullptr);
646641
}
647642
delete[] argv;
648643
#elif defined(XP_WIN)
@@ -707,25 +702,6 @@ static bool ProcessHasTerminated(ProcessType pt) {
707702
#elif defined(XP_MACOSX)
708703
// We're waiting for the process to terminate in LaunchChildMac.
709704
return true;
710-
#elif defined(XP_UNIX)
711-
int exitStatus;
712-
pid_t exited = waitpid(pt, &exitStatus, WNOHANG);
713-
if (exited == 0) {
714-
// Process is still running.
715-
sleep(1);
716-
return false;
717-
}
718-
if (exited == -1) {
719-
LOG(("Error while checking if the updater process is finished"));
720-
// This shouldn't happen, but if it does, the updater process is lost to us,
721-
// so the best we can do is pretend that it's exited.
722-
return true;
723-
}
724-
// If we get here, the process has exited; make sure it exited normally.
725-
if (WIFEXITED(exitStatus) && (WEXITSTATUS(exitStatus) != 0)) {
726-
LOG(("Error while running the updater process, check update.log"));
727-
}
728-
return true;
729705
#else
730706
// No way to have a non-blocking implementation on these platforms,
731707
// because we're using NSPR and it only provides a blocking wait.

toolkit/xre/nsUpdateDriver.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class nsIFile;
1919
#if defined(XP_WIN)
2020
# include <windows.h>
2121
typedef HANDLE ProcessType;
22-
#elif defined(XP_UNIX)
22+
#elif defined(XP_MACOSX)
2323
typedef pid_t ProcessType;
2424
#else
2525
# include "prproces.h"

0 commit comments

Comments
 (0)