summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-sysdeps-unix.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2007-06-15 19:28:36 +0000
committerHavoc Pennington <hp@redhat.com>2007-06-15 19:28:36 +0000
commit43b944a0a6ea48e8a8b06ae3e638299f591cde8d (patch)
tree0b7dc627144289e0a7cbb08546e1aee9fc07cdf3 /dbus/dbus-sysdeps-unix.c
parent283b1c6fc775c15773ebdddd423f79ad1612233d (diff)
2007-06-15 Havoc Pennington <hp@redhat.com>
* 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)
Diffstat (limited to 'dbus/dbus-sysdeps-unix.c')
-rw-r--r--dbus/dbus-sysdeps-unix.c17
1 files changed, 16 insertions, 1 deletions
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 <sys/types.h>
#include <stdlib.h>
#include <string.h>
@@ -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 */