* lib/defines.h: Avoid implicit conversion of pointers to
booleans. * lib/defines.h: Ignore return values of setlocale() except the first call. * lib/defines.h: Fix a splint observer warning by using an intermediate variable (old_locale).
This commit is contained in:
parent
1b631c42ef
commit
f42160862a
@ -1,3 +1,12 @@
|
|||||||
|
2008-06-15 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
|
* lib/defines.h: Avoid implicit conversion of pointers to
|
||||||
|
booleans.
|
||||||
|
* lib/defines.h: Ignore return values of setlocale() except the
|
||||||
|
first call.
|
||||||
|
* lib/defines.h: Fix a splint observer warning by using an
|
||||||
|
intermediate variable (old_locale).
|
||||||
|
|
||||||
2008-06-15 Nicolas François <nicolas.francois@centraliens.net>
|
2008-06-15 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
* libmisc/failure.c: Check return values. If lseek() failed, avoid
|
* libmisc/failure.c: Check return values. If lseek() failed, avoid
|
||||||
|
@ -154,17 +154,20 @@ char *strchr (), *strrchr (), *strtok ();
|
|||||||
* --Nekral */
|
* --Nekral */
|
||||||
#define SYSLOG(x) \
|
#define SYSLOG(x) \
|
||||||
do { \
|
do { \
|
||||||
char *saved_locale = setlocale(LC_ALL, NULL); \
|
char *old_locale = setlocale(LC_ALL, NULL); \
|
||||||
if (saved_locale) \
|
char *saved_locale = NULL; \
|
||||||
saved_locale = strdup(saved_locale); \
|
if (NULL != old_locale) { \
|
||||||
if (saved_locale) \
|
saved_locale = strdup (old_locale); \
|
||||||
setlocale(LC_ALL, "C"); \
|
|
||||||
syslog x ; \
|
|
||||||
if (saved_locale) { \
|
|
||||||
setlocale(LC_ALL, saved_locale); \
|
|
||||||
free(saved_locale); \
|
|
||||||
} \
|
} \
|
||||||
} while (0)
|
if (NULL != saved_locale) { \
|
||||||
|
(void) setlocale (LC_ALL, "C"); \
|
||||||
|
} \
|
||||||
|
syslog x ; \
|
||||||
|
if (NULL != saved_locale) { \
|
||||||
|
(void) setlocale (LC_ALL, saved_locale); \
|
||||||
|
free (saved_locale); \
|
||||||
|
} \
|
||||||
|
} while (false)
|
||||||
#else /* !ENABLE_NLS */
|
#else /* !ENABLE_NLS */
|
||||||
#define SYSLOG(x) syslog x
|
#define SYSLOG(x) syslog x
|
||||||
#endif /* !ENABLE_NLS */
|
#endif /* !ENABLE_NLS */
|
||||||
|
Loading…
Reference in New Issue
Block a user