mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-02 09:16:17 +01:00
Don't modify errno. (#116617, Balazs Scheidler)
Fri Feb 27 00:46:29 2004 Matthias Clasen <maclas@gmx.de> * glib/gstrfuncs.c (g_strerror): Don't modify errno. (#116617, Balazs Scheidler)
This commit is contained in:
parent
960a9899a7
commit
78adb5c69a
@ -1,3 +1,8 @@
|
||||
Fri Feb 27 00:46:29 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* glib/gstrfuncs.c (g_strerror): Don't modify errno. (#116617,
|
||||
Balazs Scheidler)
|
||||
|
||||
2004-02-26 Sebastian Wilhelmi <seppi@seppi.de>
|
||||
|
||||
* glib/gatomic.h: Fix the !G_THREADS_ENABLED case.
|
||||
|
@ -1,3 +1,8 @@
|
||||
Fri Feb 27 00:46:29 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* glib/gstrfuncs.c (g_strerror): Don't modify errno. (#116617,
|
||||
Balazs Scheidler)
|
||||
|
||||
2004-02-26 Sebastian Wilhelmi <seppi@seppi.de>
|
||||
|
||||
* glib/gatomic.h: Fix the !G_THREADS_ENABLED case.
|
||||
|
@ -1,3 +1,8 @@
|
||||
Fri Feb 27 00:46:29 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* glib/gstrfuncs.c (g_strerror): Don't modify errno. (#116617,
|
||||
Balazs Scheidler)
|
||||
|
||||
2004-02-26 Sebastian Wilhelmi <seppi@seppi.de>
|
||||
|
||||
* glib/gatomic.h: Fix the !G_THREADS_ENABLED case.
|
||||
|
@ -1,3 +1,8 @@
|
||||
Fri Feb 27 00:46:29 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* glib/gstrfuncs.c (g_strerror): Don't modify errno. (#116617,
|
||||
Balazs Scheidler)
|
||||
|
||||
2004-02-26 Sebastian Wilhelmi <seppi@seppi.de>
|
||||
|
||||
* glib/gatomic.h: Fix the !G_THREADS_ENABLED case.
|
||||
|
@ -1,3 +1,8 @@
|
||||
Fri Feb 27 00:46:29 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* glib/gstrfuncs.c (g_strerror): Don't modify errno. (#116617,
|
||||
Balazs Scheidler)
|
||||
|
||||
2004-02-26 Sebastian Wilhelmi <seppi@seppi.de>
|
||||
|
||||
* glib/gatomic.h: Fix the !G_THREADS_ENABLED case.
|
||||
|
@ -1,3 +1,8 @@
|
||||
Fri Feb 27 00:46:29 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* glib/gstrfuncs.c (g_strerror): Don't modify errno. (#116617,
|
||||
Balazs Scheidler)
|
||||
|
||||
2004-02-26 Sebastian Wilhelmi <seppi@seppi.de>
|
||||
|
||||
* glib/gatomic.h: Fix the !G_THREADS_ENABLED case.
|
||||
|
@ -727,13 +727,17 @@ g_strerror (gint errnum)
|
||||
{
|
||||
static GStaticPrivate msg_private = G_STATIC_PRIVATE_INIT;
|
||||
char *msg;
|
||||
int saved_errno = errno;
|
||||
|
||||
#ifdef HAVE_STRERROR
|
||||
const char *msg_locale;
|
||||
|
||||
msg_locale = strerror (errnum);
|
||||
if (g_get_charset (NULL))
|
||||
{
|
||||
errno = saved_errno;
|
||||
return msg_locale;
|
||||
}
|
||||
else
|
||||
{
|
||||
gchar *msg_utf8 = g_locale_to_utf8 (msg_locale, -1, NULL, NULL, NULL);
|
||||
@ -744,7 +748,9 @@ g_strerror (gint errnum)
|
||||
GQuark msg_quark = g_quark_from_string (msg_utf8);
|
||||
g_free (msg_utf8);
|
||||
|
||||
return g_quark_to_string (msg_quark);
|
||||
msg_utf8 = (gchar *) g_quark_to_string (msg_quark);
|
||||
errno = saved_errno;
|
||||
return msg_utf8;
|
||||
}
|
||||
}
|
||||
#elif NO_SYS_ERRLIST
|
||||
@ -1179,6 +1185,7 @@ g_strerror (gint errnum)
|
||||
|
||||
_g_sprintf (msg, "unknown error (%d)", errnum);
|
||||
|
||||
errno = saved_errno;
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user