mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 07:26:15 +01:00
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:
parent
9ff5d0eeed
commit
e41ebdcfcd
@ -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):
|
||||
|
@ -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):
|
||||
|
@ -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):
|
||||
|
@ -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):
|
||||
|
@ -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):
|
||||
|
@ -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):
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user