Bug 452174 - Make updater binary parent-pid command line arg optional. r=bsmedberg

This commit is contained in:
Robert Strong 2008-08-26 14:06:45 -07:00
parent 65ef12c84a
commit f54c209e31

View File

@ -1185,11 +1185,12 @@ int NS_main(int argc, NS_tchar **argv)
// necessary for the parent process to exit before its executable image may
// be altered.
if (argc < 3) {
fprintf(stderr, "Usage: updater <dir-path> <parent-pid> [working-dir callback args...]\n");
if (argc < 2) {
fprintf(stderr, "Usage: updater <dir-path> [parent-pid [working-dir callback args...]]\n");
return 1;
}
if (argc > 2 ) {
int pid = NS_tatoi(argv[2]);
if (pid) {
#ifdef XP_WIN
@ -1211,6 +1212,7 @@ int NS_main(int argc, NS_tchar **argv)
waitpid(pid, &status, 0);
#endif
}
}
#ifdef XP_WIN
// Launch a second instance of the updater with the runas verb on Windows