From 1f78014dae45ce5e6318af116ad09568c2090ad2d0a6a5bb9f05d8810bb9038d Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 1 Jul 2014 10:11:44 +0000 Subject: [PATCH] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=699 --- 0001-core-close-socket-fds-asynchronously.patch | 12 +++++++----- ...ueue-provide-file-descriptor-to-watch-busy-.patch | 7 ++++--- systemd-mini.changes | 5 +++++ systemd.changes | 5 +++++ 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/0001-core-close-socket-fds-asynchronously.patch b/0001-core-close-socket-fds-asynchronously.patch index 70eebd3c..b94b3802 100644 --- a/0001-core-close-socket-fds-asynchronously.patch +++ b/0001-core-close-socket-fds-asynchronously.patch @@ -5,9 +5,9 @@ Subject: [PATCH] core: close socket fds asynchronously http://lists.freedesktop.org/archives/systemd-devel/2014-April/018928.html --- - src/core/async.c | 22 ++++++++++++++++++++++ + src/core/async.c | 24 ++++++++++++++++++++++++ src/core/service.c | 5 +++-- - 2 files changed, 25 insertions(+), 2 deletions(-) + 2 files changed, 27 insertions(+), 2 deletions(-) --- src/core/service.c +++ src/core/service.c 2014-05-16 11:41:50.150735247 +0000 @@ -47,13 +47,15 @@ http://lists.freedesktop.org/archives/systemd-devel/2014-April/018928.html int asynchronous_job(void* (*func)(void *p), void *arg) { pthread_attr_t a; -@@ -70,3 +71,24 @@ int asynchronous_sync(void) { +@@ -70,3 +71,26 @@ int asynchronous_sync(void) { return asynchronous_job(sync_thread, NULL); } + +static void *close_thread(void *p) { -+ close_nointr_nofail(PTR_TO_INT(p)); ++ int fd = PTR_TO_INT(p); ++ if (fd >= 0) ++ close_nointr_nofail(fd); + return NULL; +} + @@ -67,7 +69,7 @@ http://lists.freedesktop.org/archives/systemd-devel/2014-April/018928.html + * far away as we can. */ + + r = asynchronous_job(close_thread, INT_TO_PTR(fd)); -+ if (r < 0) ++ if (r < 0 && fd >= 0) + close_nointr_nofail(fd); + + return -1; diff --git a/1042-libudev-queue-provide-file-descriptor-to-watch-busy-.patch b/1042-libudev-queue-provide-file-descriptor-to-watch-busy-.patch index 16cc646a..a9458e36 100644 --- a/1042-libudev-queue-provide-file-descriptor-to-watch-busy-.patch +++ b/1042-libudev-queue-provide-file-descriptor-to-watch-busy-.patch @@ -53,16 +53,17 @@ index c32a7ef..d4334b4 100644 return udev_queue; } -@@ -107,6 +110,8 @@ _public_ struct udev_queue *udev_queue_unref(struct udev_queue *udev_queue) +@@ -107,6 +110,9 @@ _public_ struct udev_queue *udev_queue_unref(struct udev_queue *udev_queue) if (udev_queue->refcount > 0) return NULL; -+ close_nointr_nofail(udev_queue->fd); ++ if (udev_queue->fd >= 0) ++ close_nointr_nofail(udev_queue->fd); + free(udev_queue); return NULL; } -@@ -222,3 +227,44 @@ _public_ struct udev_list_entry *udev_queue_get_queued_list_entry(struct udev_qu +@@ -222,3 +228,44 @@ _public_ struct udev_list_entry *udev_queue_get_queued_list_entry(struct udev_qu { return NULL; } diff --git a/systemd-mini.changes b/systemd-mini.changes index 9982508c..0ac93793 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Jul 1 09:58:04 UTC 2014 - werner@suse.de + +- Be aware that close_nointr_nofail() may fail whereas safe_close() not + ------------------------------------------------------------------- Tue Jul 1 08:56:48 UTC 2014 - werner@suse.de diff --git a/systemd.changes b/systemd.changes index 9982508c..0ac93793 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Jul 1 09:58:04 UTC 2014 - werner@suse.de + +- Be aware that close_nointr_nofail() may fail whereas safe_close() not + ------------------------------------------------------------------- Tue Jul 1 08:56:48 UTC 2014 - werner@suse.de