mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-19 21:59:17 +02:00
handle all possible cases of EAGAIN and EWOULDBLOCK being (un)defined and
2009-01-29 Ryan Lortie <desrt@desrt.ca> * gioerror.c (g_io_error_from_errno): handle all possible cases of EAGAIN and EWOULDBLOCK being (un)defined and (un)equal. svn path=/trunk/; revision=7836
This commit is contained in:
parent
129e86cf2c
commit
83e88655c0
@ -1,3 +1,8 @@
|
|||||||
|
2009-01-29 Ryan Lortie <desrt@desrt.ca>
|
||||||
|
|
||||||
|
* gioerror.c (g_io_error_from_errno): handle all possible cases of
|
||||||
|
EAGAIN and EWOULDBLOCK being (un)defined and (un)equal.
|
||||||
|
|
||||||
2009-01-28 Ryan Lortie <desrt@desrt.ca>
|
2009-01-28 Ryan Lortie <desrt@desrt.ca>
|
||||||
|
|
||||||
Bug 568575 – _async functions for GDataInputStream
|
Bug 568575 – _async functions for GDataInputStream
|
||||||
|
@ -162,10 +162,30 @@ g_io_error_from_errno (gint err_no)
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef EWOULDBLOCK
|
/* some magic to deal with EWOULDBLOCK and EAGAIN.
|
||||||
|
* apparently on HP-UX these are actually defined to different values,
|
||||||
|
* but on Linux, for example, they are the same.
|
||||||
|
*/
|
||||||
|
#if defined(EWOULDBLOCK) && defined(EAGAIN) && EWOULDBLOCK == EAGAIN
|
||||||
|
/* we have both and they are the same: only emit one case. */
|
||||||
|
case EAGAIN:
|
||||||
|
return G_IO_ERROR_WOULD_BLOCK;
|
||||||
|
break;
|
||||||
|
#else
|
||||||
|
/* else: consider each of them separately. this handles both the
|
||||||
|
* case of having only one and the case where they are different values.
|
||||||
|
*/
|
||||||
|
# ifdef EAGAIN
|
||||||
|
case EAGAIN:
|
||||||
|
return G_IO_ERROR_WOULD_BLOCK;
|
||||||
|
break;
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# ifdef EWOULDBLOCK
|
||||||
case EWOULDBLOCK:
|
case EWOULDBLOCK:
|
||||||
return G_IO_ERROR_WOULD_BLOCK;
|
return G_IO_ERROR_WOULD_BLOCK;
|
||||||
break;
|
break;
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef EMFILE
|
#ifdef EMFILE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user