Remove the quickExit function

This commit is contained in:
Eelco Dolstra 2012-11-09 16:42:10 +01:00
parent 4c9e3fa641
commit 10dcee99ed
4 changed files with 8 additions and 18 deletions

View file

@ -569,7 +569,7 @@ static void runSetuidHelper(const string & command,
catch (std::exception & e) { catch (std::exception & e) {
std::cerr << "error: " << e.what() << std::endl; std::cerr << "error: " << e.what() << std::endl;
} }
quickExit(1); _exit(1);
} }
/* Parent. */ /* Parent. */
@ -701,7 +701,7 @@ HookInstance::HookInstance()
} catch (std::exception & e) { } catch (std::exception & e) {
std::cerr << format("build hook error: %1%") % e.what() << std::endl; std::cerr << format("build hook error: %1%") % e.what() << std::endl;
} }
quickExit(1); _exit(1);
} }
/* parent */ /* parent */
@ -2146,7 +2146,7 @@ void DerivationGoal::initChild()
} catch (std::exception & e) { } catch (std::exception & e) {
std::cerr << format("build error: %1%") % e.what() << std::endl; std::cerr << format("build error: %1%") % e.what() << std::endl;
quickExit(inSetup ? childSetupFailed : 1); _exit(inSetup ? childSetupFailed : 1);
} }
abort(); /* never reached */ abort(); /* never reached */
@ -2702,7 +2702,7 @@ void SubstitutionGoal::tryToRun()
} catch (std::exception & e) { } catch (std::exception & e) {
std::cerr << format("substitute error: %1%") % e.what() << std::endl; std::cerr << format("substitute error: %1%") % e.what() << std::endl;
} }
quickExit(1); _exit(1);
} }
/* parent */ /* parent */

View file

@ -981,7 +981,7 @@ void LocalStore::startSubstituter(const Path & substituter, RunningSubstituter &
} catch (std::exception & e) { } catch (std::exception & e) {
std::cerr << "error: " << e.what() << std::endl; std::cerr << "error: " << e.what() << std::endl;
} }
quickExit(1); _exit(1);
} }
/* Parent. */ /* Parent. */

View file

@ -847,9 +847,9 @@ void killUser(uid_t uid)
} catch (std::exception & e) { } catch (std::exception & e) {
std::cerr << format("killing processes belonging to uid `%1%': %2%") std::cerr << format("killing processes belonging to uid `%1%': %2%")
% uid % e.what() << std::endl; % uid % e.what() << std::endl;
quickExit(1); _exit(1);
} }
quickExit(0); _exit(0);
} }
/* parent */ /* parent */
@ -905,7 +905,7 @@ string runProgram(Path program, bool searchPath, const Strings & args)
} catch (std::exception & e) { } catch (std::exception & e) {
std::cerr << "error: " << e.what() << std::endl; std::cerr << "error: " << e.what() << std::endl;
} }
quickExit(1); _exit(1);
} }
/* Parent. */ /* Parent. */
@ -944,12 +944,6 @@ void closeOnExec(int fd)
} }
void quickExit(int status)
{
_exit(status);
}
void setuidCleanup() void setuidCleanup()
{ {
/* Don't trust the environment. */ /* Don't trust the environment. */

View file

@ -262,10 +262,6 @@ void closeMostFDs(const set<int> & exceptions);
/* Set the close-on-exec flag for the given file descriptor. */ /* Set the close-on-exec flag for the given file descriptor. */
void closeOnExec(int fd); void closeOnExec(int fd);
/* Wrapper around _exit() on Unix and ExitProcess() on Windows. (On
Cygwin, _exit() doesn't seem to do the right thing.) */
void quickExit(int status);
/* Common initialisation for setuid programs: clear the environment, /* Common initialisation for setuid programs: clear the environment,
sanitize file handles 0, 1 and 2. */ sanitize file handles 0, 1 and 2. */
void setuidCleanup(); void setuidCleanup();