From ff140aa613ba340ec430f95a4e6d4f59e0a3d80a Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Tue, 27 Apr 1999 17:14:45 +0000 Subject: [PATCH] Mask out ERR HUP and NVAL from the events field so we don't give IRIX Tue Apr 27 13:11:29 1999 Owen Taylor * gmain.c (g_main_poll): Mask out ERR HUP and NVAL from the events field so we don't give IRIX fits. --- ChangeLog | 5 +++++ ChangeLog.pre-2-0 | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-12 | 5 +++++ ChangeLog.pre-2-2 | 5 +++++ ChangeLog.pre-2-4 | 5 +++++ ChangeLog.pre-2-6 | 5 +++++ ChangeLog.pre-2-8 | 5 +++++ glib/gmain.c | 7 ++++++- gmain.c | 7 ++++++- 10 files changed, 52 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b71f3fa9a..4f20f365f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Apr 27 13:11:29 1999 Owen Taylor + + * gmain.c (g_main_poll): Mask out ERR HUP and NVAL from + the events field so we don't give IRIX fits. + Tue Apr 20 08:42:22 1999 Tim Janik * gscanner.c (g_scanner_unexp_token): behave conservative with diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index b71f3fa9a..4f20f365f 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,8 @@ +Tue Apr 27 13:11:29 1999 Owen Taylor + + * gmain.c (g_main_poll): Mask out ERR HUP and NVAL from + the events field so we don't give IRIX fits. + Tue Apr 20 08:42:22 1999 Tim Janik * gscanner.c (g_scanner_unexp_token): behave conservative with diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index b71f3fa9a..4f20f365f 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +Tue Apr 27 13:11:29 1999 Owen Taylor + + * gmain.c (g_main_poll): Mask out ERR HUP and NVAL from + the events field so we don't give IRIX fits. + Tue Apr 20 08:42:22 1999 Tim Janik * gscanner.c (g_scanner_unexp_token): behave conservative with diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index b71f3fa9a..4f20f365f 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,8 @@ +Tue Apr 27 13:11:29 1999 Owen Taylor + + * gmain.c (g_main_poll): Mask out ERR HUP and NVAL from + the events field so we don't give IRIX fits. + Tue Apr 20 08:42:22 1999 Tim Janik * gscanner.c (g_scanner_unexp_token): behave conservative with diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index b71f3fa9a..4f20f365f 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,8 @@ +Tue Apr 27 13:11:29 1999 Owen Taylor + + * gmain.c (g_main_poll): Mask out ERR HUP and NVAL from + the events field so we don't give IRIX fits. + Tue Apr 20 08:42:22 1999 Tim Janik * gscanner.c (g_scanner_unexp_token): behave conservative with diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index b71f3fa9a..4f20f365f 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,8 @@ +Tue Apr 27 13:11:29 1999 Owen Taylor + + * gmain.c (g_main_poll): Mask out ERR HUP and NVAL from + the events field so we don't give IRIX fits. + Tue Apr 20 08:42:22 1999 Tim Janik * gscanner.c (g_scanner_unexp_token): behave conservative with diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index b71f3fa9a..4f20f365f 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +Tue Apr 27 13:11:29 1999 Owen Taylor + + * gmain.c (g_main_poll): Mask out ERR HUP and NVAL from + the events field so we don't give IRIX fits. + Tue Apr 20 08:42:22 1999 Tim Janik * gscanner.c (g_scanner_unexp_token): behave conservative with diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index b71f3fa9a..4f20f365f 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +Tue Apr 27 13:11:29 1999 Owen Taylor + + * gmain.c (g_main_poll): Mask out ERR HUP and NVAL from + the events field so we don't give IRIX fits. + Tue Apr 20 08:42:22 1999 Tim Janik * gscanner.c (g_scanner_unexp_token): behave conservative with diff --git a/glib/gmain.c b/glib/gmain.c index 440577981..991bf1264 100644 --- a/glib/gmain.c +++ b/glib/gmain.c @@ -998,7 +998,12 @@ g_main_poll (gint timeout, if (pollrec->fd->events) { fd_array[i].fd = pollrec->fd->fd; - fd_array[i].events = pollrec->fd->events; + /* In direct contradiction to the Unix98 spec, IRIX runs into + * difficulty if you pass in POLLERR, POLLHUP or POLLNVAL + * flags in the events field of the pollfd while it should + * just ignoring them. So we mask them out here. + */ + fd_array[i].events = pollrec->fd->events & ~(G_IO_ERR|G_IO_HUP|G_IO_NVAL); fd_array[i].revents = 0; i++; } diff --git a/gmain.c b/gmain.c index 440577981..991bf1264 100644 --- a/gmain.c +++ b/gmain.c @@ -998,7 +998,12 @@ g_main_poll (gint timeout, if (pollrec->fd->events) { fd_array[i].fd = pollrec->fd->fd; - fd_array[i].events = pollrec->fd->events; + /* In direct contradiction to the Unix98 spec, IRIX runs into + * difficulty if you pass in POLLERR, POLLHUP or POLLNVAL + * flags in the events field of the pollfd while it should + * just ignoring them. So we mask them out here. + */ + fd_array[i].events = pollrec->fd->events & ~(G_IO_ERR|G_IO_HUP|G_IO_NVAL); fd_array[i].revents = 0; i++; }