diff options
author | George Lebl <jirka@5z.com> | 2001-09-27 07:02:25 +0000 |
---|---|---|
committer | George Lebl <jirka@src.gnome.org> | 2001-09-27 07:02:25 +0000 |
commit | ab2837a1b0316d1183ca5c7ba03d08f0faddad15 (patch) | |
tree | b91d5eab034daf5cba3d4240d9ae62c4e7099ab2 /daemon/gdm-net.c | |
parent | fed3c0d16a1bfd742e1ee455986aa7cbfe8f1d10 (diff) | |
download | gdm-ab2837a1b0316d1183ca5c7ba03d08f0faddad15.tar.gz |
deal with the case where MSG_NOSIGNAL is not defined by temporairly
Wed Sep 26 23:54:11 2001 George Lebl <jirka@5z.com>
* daemon/gdm-net.c, gui/gdmflexiserver.c: deal with the case where
MSG_NOSIGNAL is not defined by temporairly ignoring the SIGPIPE
signal. Fixes #60586
Diffstat (limited to 'daemon/gdm-net.c')
-rw-r--r-- | daemon/gdm-net.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/daemon/gdm-net.c b/daemon/gdm-net.c index 0ea0b35d..188bf09c 100644 --- a/daemon/gdm-net.c +++ b/daemon/gdm-net.c @@ -150,13 +150,26 @@ gdm_connection_is_writable (GdmConnection *conn) gboolean gdm_connection_write (GdmConnection *conn, const char *str) { + int ret; +#ifndef MSG_NOSIGNAL + void (*old_handler)(int); +#endif + g_return_val_if_fail (conn != NULL, FALSE); g_return_val_if_fail (str != NULL, FALSE); if ( ! conn->writable) return FALSE; - if (send (conn->fd, str, strlen (str), MSG_NOSIGNAL) < 0) +#ifdef MSG_NOSIGNAL + ret = send (conn->fd, str, strlen (str), MSG_NOSIGNAL); +#else + old_handler = signal (SIGPIPE, SIG_IGN); + ret = send (conn->fd, str, strlen (str), 0); + signal (SIGPIPE, old_handler); +#endif + + if (ret < 0) return FALSE; else return TRUE; |