|
|
7f93bc2 |
From f24d57354422da412a4791a27dbd40760073cea9 Mon Sep 17 00:00:00 2001
|
|
|
a59965a |
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
|
a59965a |
Date: Tue, 13 May 2014 23:22:13 +0200
|
|
|
a59965a |
Subject: [PATCH] core: close socket fds asynchronously
|
|
|
a59965a |
|
|
|
a59965a |
http://lists.freedesktop.org/archives/systemd-devel/2014-April/018928.html
|
|
|
a59965a |
(cherry picked from commit 574634bcacb01efe15ca2742effd461a5b7afb5f)
|
|
|
a59965a |
(cherry picked from commit ea74f003b0cbc37e76a2ad72460bfb317b880147)
|
|
|
a59965a |
---
|
|
|
a59965a |
src/core/service.c | 5 +++--
|
|
|
a59965a |
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
a59965a |
|
|
|
a59965a |
diff --git a/src/core/service.c b/src/core/service.c
|
|
|
a59965a |
index f0df5fe..9fd58fa 100644
|
|
|
a59965a |
--- a/src/core/service.c
|
|
|
a59965a |
+++ b/src/core/service.c
|
|
|
a59965a |
@@ -25,6 +25,7 @@
|
|
|
a59965a |
#include <unistd.h>
|
|
|
a59965a |
#include <sys/reboot.h>
|
|
|
a59965a |
|
|
|
a59965a |
+#include "async.h"
|
|
|
a59965a |
#include "manager.h"
|
|
|
a59965a |
#include "unit.h"
|
|
|
a59965a |
#include "service.h"
|
|
|
a59965a |
@@ -222,7 +223,7 @@ static void service_close_socket_fd(Service *s) {
|
|
|
a59965a |
if (s->socket_fd < 0)
|
|
|
a59965a |
return;
|
|
|
a59965a |
|
|
|
a59965a |
- s->socket_fd = safe_close(s->socket_fd);
|
|
|
a59965a |
+ s->socket_fd = asynchronous_close(s->socket_fd);
|
|
|
a59965a |
}
|
|
|
a59965a |
|
|
|
a59965a |
static void service_connection_unref(Service *s) {
|
|
|
a59965a |
@@ -2793,7 +2794,7 @@ static int service_deserialize_item(Unit *u, const char *key, const char *value,
|
|
|
a59965a |
log_debug_unit(u->id, "Failed to parse socket-fd value %s", value);
|
|
|
a59965a |
else {
|
|
|
a59965a |
|
|
|
a59965a |
- safe_close(s->socket_fd);
|
|
|
a59965a |
+ asynchronous_close(s->socket_fd);
|
|
|
a59965a |
s->socket_fd = fdset_remove(fds, fd);
|
|
|
a59965a |
}
|
|
|
a59965a |
} else if (streq(key, "main-exec-status-pid")) {
|