mirror of
https://github.com/systemd/systemd.git
synced 2025-03-19 22:50:17 +03:00
core/service: service_add_fd_store() consumes passed fd
Without this change, the fd is closed twice on failure. Fixes a bug introduced by dff9808a628c31b7ecb1f1aba8fdc3be06ce8372. Fixes #35288. (cherry picked from commit d99198819caeff6f40a0a520364e59b8a0cbaa4f)
This commit is contained in:
parent
38e0f618ee
commit
6dcb53ba0a
@ -3259,14 +3259,13 @@ static int service_deserialize_item(Unit *u, const char *key, const char *value,
|
||||
return 0;
|
||||
}
|
||||
|
||||
r = service_add_fd_store(s, fd, fdn, do_poll);
|
||||
r = service_add_fd_store(s, TAKE_FD(fd), fdn, do_poll);
|
||||
if (r < 0) {
|
||||
log_unit_debug_errno(u, r,
|
||||
"Failed to store deserialized fd '%s', ignoring: %m", fdn);
|
||||
return 0;
|
||||
}
|
||||
|
||||
TAKE_FD(fd);
|
||||
} else if (streq(key, "main-exec-status-pid")) {
|
||||
pid_t pid;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user