mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-10-03 23:38:39 +00:00
core: close socket fds asynchronously
http://lists.freedesktop.org/archives/systemd-devel/2014-April/018928.html
(cherry picked from commit 574634bcac)
This commit is contained in:
+3
-2
@@ -25,6 +25,7 @@
|
||||
#include <unistd.h>
|
||||
#include <sys/reboot.h>
|
||||
|
||||
#include "async.h"
|
||||
#include "manager.h"
|
||||
#include "unit.h"
|
||||
#include "service.h"
|
||||
@@ -226,7 +227,7 @@ static void service_close_socket_fd(Service *s) {
|
||||
if (s->socket_fd < 0)
|
||||
return;
|
||||
|
||||
s->socket_fd = safe_close(s->socket_fd);
|
||||
s->socket_fd = asynchronous_close(s->socket_fd);
|
||||
}
|
||||
|
||||
static void service_connection_unref(Service *s) {
|
||||
@@ -2685,7 +2686,7 @@ static int service_deserialize_item(Unit *u, const char *key, const char *value,
|
||||
log_debug_unit(u->id, "Failed to parse socket-fd value %s", value);
|
||||
else {
|
||||
|
||||
safe_close(s->socket_fd);
|
||||
asynchronous_close(s->socket_fd);
|
||||
s->socket_fd = fdset_remove(fds, fd);
|
||||
}
|
||||
} else if (streq(key, "main-exec-status-pid")) {
|
||||
|
||||
Reference in New Issue
Block a user