summaryrefslogtreecommitdiff
path: root/dbus/dbus-sysdeps.c
diff options
context:
space:
mode:
authorMarcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>2010-03-16 03:27:42 +0100
committerRalf Habacker <ralf.habacker@freenet.de>2010-04-13 15:46:35 +0200
commit6e214b5b3c283798b5743b4ebf7c9ec466fe3667 (patch)
treeb0659fce7a78777f22e644f25d86d1512b51e193 /dbus/dbus-sysdeps.c
parent4708efeebbac8a6345811e38da86961155e2b4ae (diff)
downloaddbus-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.c19
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