From 43b944a0a6ea48e8a8b06ae3e638299f591cde8d Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Fri, 15 Jun 2007 19:28:36 +0000 Subject: 2007-06-15 Havoc Pennington * dbus/dbus-sysdeps.c (_dbus_set_errno_to_zero) (_dbus_get_is_errno_nonzero, _dbus_get_is_errno_eintr) (_dbus_strerror_from_errno): family of functions to abstract errno, though these are somewhat bogus (really we should make our socket wrappers not use errno probably - the issue is that any usage of errno that isn't socket-related probably is not cross-platform, so should either be in a unix-only file that can use errno directly, or is a bug - these general errno wrappers hide issues of this nature in non-socket code, while socket-specific API changes would not since sockets are allowed cross-platform) --- dbus/dbus-sysdeps-unix.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'dbus/dbus-sysdeps-unix.c') diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c index 6ba3da0d..1e4cf8dd 100644 --- a/dbus/dbus-sysdeps-unix.c +++ b/dbus/dbus-sysdeps-unix.c @@ -32,6 +32,7 @@ #include "dbus-userdb.h" #include "dbus-list.h" #include "dbus-credentials.h" + #include #include #include @@ -2327,7 +2328,8 @@ _dbus_exit (int code) /** * A wrapper around strerror() because some platforms - * may be lame and not have strerror(). + * may be lame and not have strerror(). Also, never + * returns NULL. * * @param error_number errno. * @returns error description. @@ -2993,4 +2995,17 @@ _dbus_append_keyring_directory_for_credentials (DBusString *directory, return FALSE; } + +/** + * See if errno is EAGAIN or EWOULDBLOCK (this has to be done differently + * for Winsock so is abstracted) + * + * @returns #TRUE if errno == EAGAIN or errno == EWOULDBLOCK + */ +dbus_bool_t +_dbus_get_is_errno_eagain_or_ewouldblock (void) +{ + return errno == EAGAIN || errno == EWOULDBLOCK; +} + /* tests in dbus-sysdeps-util.c */ -- cgit