diff options
author | Steffen Nurpmeso <steffen@sdaoden.eu> | 2020-08-11 16:28:37 +0200 |
---|---|---|
committer | Steffen Nurpmeso <steffen@sdaoden.eu> | 2020-08-11 16:37:31 +0200 |
commit | c4902c40c32833a2160882e0805f0ad804da91fe (patch) | |
tree | ed71f1a5d3d8a42bdc44abc0b15d8235df650982 /start-stop-daemon.c | |
parent | 31401da642c63a50085b41061228e28072c9b15d (diff) | |
download | start-stop-daemon-c4902c40c32833a2160882e0805f0ad804da91fe.tar.gz start-stop-daemon-c4902c40c32833a2160882e0805f0ad804da91fe.tar.xz |
Diffstat (limited to 'start-stop-daemon.c')
-rw-r--r-- | start-stop-daemon.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/start-stop-daemon.c b/start-stop-daemon.c index 88c9726..3947cc0 100644 --- a/start-stop-daemon.c +++ b/start-stop-daemon.c @@ -551,8 +551,8 @@ wait_for_child(pid_t pid) static void cleanup_socket_dir(void) { - unlink(notify_socket); - rmdir(notify_sockdir); + (void)unlink(notify_socket); + (void)rmdir(notify_sockdir); } static char * @@ -593,7 +593,7 @@ set_socket_passcred(int fd) #ifdef SO_PASSCRED static const int enable = 1; - setsockopt(fd, SOL_SOCKET, SO_PASSCRED, &enable, sizeof(enable)); + (void)setsockopt(fd, SOL_SOCKET, SO_PASSCRED, &enable, sizeof(enable)); #endif } @@ -807,6 +807,10 @@ daemonize(void) _exit(0); } + /* Close the notification socket, even though it is close-on-exec. */ + if (notify_await) + close(notify_fd); + /* Create a new session. */ if (setsid() < 0) fatale("cannot set session ID"); @@ -1359,6 +1363,7 @@ parse_options(int argc, char * const *argv) execname = optarg; break; case 'c': /* --chuid <username>|<uid> */ + free(changeuser); /* We copy the string just in case we need the * argument later. */ changeuser_len = strcspn(optarg, ":"); |