diff options
author | Tomas Bzatek <tbzatek@redhat.com> | 2011-08-29 14:50:50 +0200 |
---|---|---|
committer | Tomas Bzatek <tbzatek@redhat.com> | 2011-08-29 14:50:50 +0200 |
commit | 9dcde52c3e6b8164180cfe8a60896b6d5e1e8c97 (patch) | |
tree | 4e3b5b7a636805e24dbd4197e07dde10009b30c2 /daemon/daemon-main.c | |
parent | d48afc9cce04fb4aa0b2a45d81d5ce7c75ca954f (diff) | |
download | gvfs-9dcde52c3e6b8164180cfe8a60896b6d5e1e8c97.tar.gz |
Ignore SIGPIPE signals to avoid process termination on cancelled transfer
That way we would be able to properly get EPIPE when trying to write to
a socket or pipe whose far end has been closed. This happens e.g. on
file copy cancellation. Glib does similar thing on GSocket initialization.
https://bugzilla.gnome.org/show_bug.cgi?id=649041
Diffstat (limited to 'daemon/daemon-main.c')
-rw-r--r-- | daemon/daemon-main.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/daemon/daemon-main.c b/daemon/daemon-main.c index bc533461..ef9025ce 100644 --- a/daemon/daemon-main.c +++ b/daemon/daemon-main.c @@ -68,6 +68,12 @@ daemon_init (void) g_log_set_handler (NULL, G_LOG_LEVEL_DEBUG, log_debug, NULL); +#ifdef SIGPIPE + /* Ignore SIGPIPE to avoid killing daemons on cancelled transfer * + * See https://bugzilla.gnome.org/show_bug.cgi?id=649041 * + */ + signal (SIGPIPE, SIG_IGN); +#endif dbus_error_init (&derror); connection = dbus_bus_get (DBUS_BUS_SESSION, &derror); |