From baed1ae935739f399f3a991e67760e6da39df284 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 3 Dec 2012 17:43:31 +0000 Subject: [PATCH 3/6] dbus-spawn: correct a comment that falsely claimed thread-safety --- dbus/dbus-spawn.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dbus/dbus-spawn.c b/dbus/dbus-spawn.c index 96cd039..116a214 100644 --- a/dbus/dbus-spawn.c +++ b/dbus/dbus-spawn.c @@ -837,9 +837,14 @@ handle_watch (DBusWatch *watch, #define WRITE_END 1 -/* Avoids a danger in threaded situations (calling close() - * on a file descriptor twice, and another thread has - * re-opened it since the first close) +/* Avoids a danger in re-entrant situations (calling close() + * on a file descriptor twice, and another module has + * re-opened it since the first close). + * + * This previously claimed to be relevant for threaded situations, but by + * trivial inspection, it is not thread-safe. It doesn't actually + * matter, since this module is only used in the -util variant of the + * library, which is only used in single-threaded situations. */ static int close_and_invalidate (int *fd) -- 1.7.10.4