replace exit and _exit with std variants
_exit and std::_Exit are identical, expect the latter is standard C++. Added several functions to the std namespace as a result of headers. Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
@@ -27,8 +27,6 @@
|
||||
#include "PidFile.hxx"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifndef _WIN32
|
||||
@@ -81,7 +79,7 @@ daemonize_kill()
|
||||
if (kill(pid, SIGTERM) < 0)
|
||||
throw FormatErrno("unable to kill process %i", int(pid));
|
||||
|
||||
exit(EXIT_SUCCESS);
|
||||
std::exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -180,7 +178,7 @@ daemonize_begin(bool detach)
|
||||
if (nbytes == (ssize_t)sizeof(result)) {
|
||||
/* the child process was successful */
|
||||
pidfile2.Write(pid);
|
||||
exit(EXIT_SUCCESS);
|
||||
std::exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
/* something bad happened in the child process */
|
||||
@@ -196,7 +194,7 @@ daemonize_begin(bool detach)
|
||||
throw FormatErrno("MPD died from signal %d%s", WTERMSIG(status),
|
||||
WCOREDUMP(status) ? " (core dumped)" : "");
|
||||
|
||||
exit(WEXITSTATUS(status));
|
||||
std::exit(WEXITSTATUS(status));
|
||||
}
|
||||
|
||||
void
|
||||
|
Reference in New Issue
Block a user