Silently return G_IO_CHANNEL_ERROR_FAILED for EINTR, since close() can

Fri May 30 16:48:26 2003  Owen Taylor  <otaylor@redhat.com>

        * glib/giochannel.c (g_io_channel_error_from_errno):
        Silently return G_IO_CHANNEL_ERROR_FAILED for EINTR,
        since close() can return EINTR. (#11842, Balazs Scheidler)
This commit is contained in:
Owen Taylor 2003-05-30 21:11:08 +00:00 committed by Owen Taylor
parent 9ff5d0eeed
commit e41ebdcfcd
7 changed files with 48 additions and 3 deletions

View File

@ -1,3 +1,9 @@
Fri May 30 16:48:26 2003 Owen Taylor <otaylor@redhat.com>
* glib/giochannel.c (g_io_channel_error_from_errno):
Silently return G_IO_CHANNEL_ERROR_FAILED for EINTR,
since close() can return EINTR. (#11842, Balazs Scheidler)
Fri May 30 15:51:43 2003 Owen Taylor <otaylor@redhat.com>
* glib/giochannel.c (g_io_error_get_from_g_error):

View File

@ -1,3 +1,9 @@
Fri May 30 16:48:26 2003 Owen Taylor <otaylor@redhat.com>
* glib/giochannel.c (g_io_channel_error_from_errno):
Silently return G_IO_CHANNEL_ERROR_FAILED for EINTR,
since close() can return EINTR. (#11842, Balazs Scheidler)
Fri May 30 15:51:43 2003 Owen Taylor <otaylor@redhat.com>
* glib/giochannel.c (g_io_error_get_from_g_error):

View File

@ -1,3 +1,9 @@
Fri May 30 16:48:26 2003 Owen Taylor <otaylor@redhat.com>
* glib/giochannel.c (g_io_channel_error_from_errno):
Silently return G_IO_CHANNEL_ERROR_FAILED for EINTR,
since close() can return EINTR. (#11842, Balazs Scheidler)
Fri May 30 15:51:43 2003 Owen Taylor <otaylor@redhat.com>
* glib/giochannel.c (g_io_error_get_from_g_error):

View File

@ -1,3 +1,9 @@
Fri May 30 16:48:26 2003 Owen Taylor <otaylor@redhat.com>
* glib/giochannel.c (g_io_channel_error_from_errno):
Silently return G_IO_CHANNEL_ERROR_FAILED for EINTR,
since close() can return EINTR. (#11842, Balazs Scheidler)
Fri May 30 15:51:43 2003 Owen Taylor <otaylor@redhat.com>
* glib/giochannel.c (g_io_error_get_from_g_error):

View File

@ -1,3 +1,9 @@
Fri May 30 16:48:26 2003 Owen Taylor <otaylor@redhat.com>
* glib/giochannel.c (g_io_channel_error_from_errno):
Silently return G_IO_CHANNEL_ERROR_FAILED for EINTR,
since close() can return EINTR. (#11842, Balazs Scheidler)
Fri May 30 15:51:43 2003 Owen Taylor <otaylor@redhat.com>
* glib/giochannel.c (g_io_error_get_from_g_error):

View File

@ -1,3 +1,9 @@
Fri May 30 16:48:26 2003 Owen Taylor <otaylor@redhat.com>
* glib/giochannel.c (g_io_channel_error_from_errno):
Silently return G_IO_CHANNEL_ERROR_FAILED for EINTR,
since close() can return EINTR. (#11842, Balazs Scheidler)
Fri May 30 15:51:43 2003 Owen Taylor <otaylor@redhat.com>
* glib/giochannel.c (g_io_error_get_from_g_error):

View File

@ -547,9 +547,6 @@ g_io_channel_error_from_errno (gint en)
#ifdef EAGAIN
g_return_val_if_fail (en != EAGAIN, G_IO_CHANNEL_ERROR_FAILED);
#endif
#ifdef EINTR
g_return_val_if_fail (en != EINTR, G_IO_CHANNEL_ERROR_FAILED);
#endif
switch (en)
{
@ -570,6 +567,18 @@ g_io_channel_error_from_errno (gint en)
return G_IO_CHANNEL_ERROR_FBIG;
#endif
#ifdef EINTR
/* In general, we should catch EINTR before we get here,
* but close() is allowed to return EINTR by POSIX, so
* we need to catch it here; EINTR from close() is
* unrecoverable, because it's undefined whether
* the fd was actually closed or not, so we just return
* a generic error code.
*/
case EINTR:
return G_IO_CHANNEL_ERROR_FAILED;
#endif
#ifdef EINVAL
case EINVAL:
return G_IO_CHANNEL_ERROR_INVAL;