diff options
author | Stefan Metzmacher <metze@samba.org> | 2006-09-29 12:38:51 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:20:28 -0500 |
commit | e8a005acfe15462b2f7e2aaa66a585d6da098a09 (patch) | |
tree | c4e266c054da50cd5d412d89af8861e55a090c13 /source4/lib | |
parent | 9eab500f56140b002e5579cac114c3c6855e647e (diff) | |
download | samba-e8a005acfe15462b2f7e2aaa66a585d6da098a09.tar.gz samba-e8a005acfe15462b2f7e2aaa66a585d6da098a09.tar.bz2 samba-e8a005acfe15462b2f7e2aaa66a585d6da098a09.zip |
r18999: merge from samba3:
- make more usage of PRINTF_ATTRIBUTE()
- vsyslog takes a 'const char *format'
metze
(This used to be commit cdcd4232d2f383f4d2f9ca1d049b7b3cc7b58359)
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/replace/replace.c | 2 | ||||
-rw-r--r-- | source4/lib/replace/replace.h | 17 |
2 files changed, 9 insertions, 10 deletions
diff --git a/source4/lib/replace/replace.c b/source4/lib/replace/replace.c index aa3e8717c2..e7f47d7d52 100644 --- a/source4/lib/replace/replace.c +++ b/source4/lib/replace/replace.c @@ -346,7 +346,7 @@ void rep_setlinebuf(FILE *stream) #ifndef HAVE_VSYSLOG #ifdef HAVE_SYSLOG -void rep_vsyslog (int facility_priority, char *format, va_list arglist) +void rep_vsyslog (int facility_priority, const char *format, va_list arglist) { char *msg = NULL; vasprintf(&msg, format, arglist); diff --git a/source4/lib/replace/replace.h b/source4/lib/replace/replace.h index b24724ec8e..8943c7d637 100644 --- a/source4/lib/replace/replace.h +++ b/source4/lib/replace/replace.h @@ -153,13 +153,6 @@ int rep_setegid(gid_t); void rep_setlinebuf(FILE *); #endif -#ifndef HAVE_VSYSLOG -#ifdef HAVE_SYSLOG -#define vsyslog rep_vsyslog -void rep_vsyslog (int facility_priority, char *format, va_list arglist); -#endif -#endif - #ifndef HAVE_STRCASESTR #define strcasestr rep_strcasestr char *rep_strcasestr(const char *haystack, const char *needle); @@ -229,7 +222,7 @@ int rep_dlclose(void *handle); #ifndef HAVE_VASPRINTF #define vasprintf rep_vasprintf -int rep_vasprintf(char **ptr, const char *format, va_list ap); +int rep_vasprintf(char **ptr, const char *format, va_list ap) PRINTF_ATTRIBUTE(2,0); #endif #if !defined(HAVE_SNPRINTF) || !defined(HAVE_C99_VSNPRINTF) @@ -239,7 +232,7 @@ int rep_snprintf(char *,size_t ,const char *, ...) PRINTF_ATTRIBUTE(3,4); #if !defined(HAVE_VSNPRINTF) || !defined(HAVE_C99_VSNPRINTF) #define vsnprintf rep_vsnprintf -int rep_vsnprintf(char *,size_t ,const char *, va_list ap); +int rep_vsnprintf(char *,size_t ,const char *, va_list ap) PRINTF_ATTRIBUTE(3,0); #endif #ifndef HAVE_ASPRINTF @@ -247,6 +240,12 @@ int rep_vsnprintf(char *,size_t ,const char *, va_list ap); int rep_asprintf(char **,const char *, ...) PRINTF_ATTRIBUTE(2,3); #endif +#ifndef HAVE_VSYSLOG +#ifdef HAVE_SYSLOG +#define vsyslog rep_vsyslog +void rep_vsyslog (int facility_priority, const char *format, va_list arglist) PRINTF_ATTRIBUTE(2,0); +#endif +#endif /* we used to use these fns, but now we have good replacements for snprintf and vsnprintf */ |