mirror of
https://github.com/troglobit/finit.git
synced 2026-09-30 21:13:01 +07:00
libsystemd: fix socket leak in sd_notify()
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -78,10 +78,9 @@ int sd_notify(int unset_environment, const char *state)
|
||||
unsetenv("NOTIFY_SOCKET");
|
||||
|
||||
written = write(sd, state, len);
|
||||
if (written != (ssize_t) len) {
|
||||
close(sd);
|
||||
close(sd);
|
||||
if (written != (ssize_t) len)
|
||||
return written < 0 ? -errno : -EPROTO;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user