diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-06-29 16:25:08 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-08-05 14:39:27 +0100 |
commit | 05389054bdad39851b551a79b53e60dc91e30976 (patch) | |
tree | b6447ad95a3ba1ac7673ebe0d74ea87fe6f4c307 /bus/main.c | |
parent | e90e7e9e7188c61ca06928e3c18a5db4eaf9dd27 (diff) | |
download | dbus-05389054bdad39851b551a79b53e60dc91e30976.tar.gz |
bus signal_handler: comment why it's OK if the reload pipe gets full
Backported to dbus-1.4, originally part of commit c7ef3ead558e147.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33336
Reviewed-by: Thiago Macieira <thiago@kde.org>
Diffstat (limited to 'bus/main.c')
-rw-r--r-- | bus/main.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -74,6 +74,19 @@ signal_handler (int sig) if ((reload_pipe[RELOAD_WRITE_END] > 0) && !_dbus_write_socket (reload_pipe[RELOAD_WRITE_END], &str, 0, 1)) { + /* If we receive SIGHUP often enough to fill the pipe buffer (4096 + * times on old Linux, 65536 on modern Linux) before it can be + * drained, let's just warn and ignore. The configuration will be + * reloaded while draining the pipe buffer, which is what we + * wanted. It's harmless that it will be reloaded fewer times than + * we asked for, since the reload is delayed anyway, so new changes + * will be picked up. + * + * We use write() because _dbus_warn uses vfprintf, which isn't + * async-signal-safe. + * + * This is necessarily Unix-specific, but so are POSIX signals, + * so... */ static const char message[] = "Unable to write to reload pipe - buffer full?\n"; |