summaryrefslogtreecommitdiff
path: root/src/unix
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2020-03-26 18:44:09 -0700
committerRosen Penev <rosenp@gmail.com>2020-03-26 18:44:09 -0700
commit3540cf26b1b342f175255f2dc02e615483a1383c (patch)
tree0354221ec3360b4c4a8a77da1f692a6bfd501ba3 /src/unix
parentcfa4524cb311024ede0675939d8a7f7a262d0d54 (diff)
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>
Diffstat (limited to 'src/unix')
-rw-r--r--src/unix/Daemon.cxx8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/unix/Daemon.cxx b/src/unix/Daemon.cxx
index dffd4fe54..92b85a020 100644
--- a/src/unix/Daemon.cxx
+++ b/src/unix/Daemon.cxx
@@ -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