diff options
author | Marcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de> | 2010-03-16 03:27:42 +0100 |
---|---|---|
committer | Ralf Habacker <ralf.habacker@freenet.de> | 2010-04-13 15:46:35 +0200 |
commit | 6e214b5b3c283798b5743b4ebf7c9ec466fe3667 (patch) | |
tree | b0659fce7a78777f22e644f25d86d1512b51e193 /dbus/dbus-sysdeps.c | |
parent | 4708efeebbac8a6345811e38da86961155e2b4ae (diff) | |
download | dbus-6e214b5b3c283798b5743b4ebf7c9ec466fe3667.tar.gz |
Prepare for WinCE port: Convert windows code to native API, avoid errno.
Diffstat (limited to 'dbus/dbus-sysdeps.c')
-rw-r--r-- | dbus/dbus-sysdeps.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/dbus/dbus-sysdeps.c b/dbus/dbus-sysdeps.c index de9f9040..afa5664a 100644 --- a/dbus/dbus-sysdeps.c +++ b/dbus/dbus-sysdeps.c @@ -518,7 +518,7 @@ _dbus_string_parse_int (const DBusString *str, _dbus_string_get_length (str) - start); end = NULL; - errno = 0; + _dbus_set_errno_to_zero (); v = strtol (p, &end, 0); if (end == NULL || end == p || errno != 0) return FALSE; @@ -557,7 +557,7 @@ _dbus_string_parse_uint (const DBusString *str, _dbus_string_get_length (str) - start); end = NULL; - errno = 0; + _dbus_set_errno_to_zero (); v = strtoul (p, &end, 0); if (end == NULL || end == p || errno != 0) return FALSE; @@ -699,7 +699,7 @@ ascii_strtod (const char *nptr, /* Set errno to zero, so that we can distinguish zero results and underflows */ - errno = 0; + _dbus_set_errno_to_zero (); if (decimal_point_pos) { @@ -773,7 +773,7 @@ _dbus_string_parse_double (const DBusString *str, return FALSE; end = NULL; - errno = 0; + _dbus_set_errno_to_zero (); v = ascii_strtod (p, &end); if (end == NULL || end == p || errno != 0) return FALSE; @@ -994,6 +994,17 @@ _dbus_error_from_errno (int error_number) } /** + * Converts the current system errno value into a #DBusError name. + * + * @returns an error name + */ +const char* +_dbus_error_from_system_errno (void) +{ + return _dbus_error_from_errno (errno); +} + +/** * Assign 0 to the global errno variable */ void |