From a468f9459ca49e889ab9d3af60176c638dd78811 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 30 Jan 1997 17:47:26 +0000 Subject: Configure for absent vsyslog. svn path=/trunk/; revision=843 --- acconfig.h | 6 ++++++ configure.in | 2 +- report.c | 26 +++++++++++++++++++++++++- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/acconfig.h b/acconfig.h index 54458058..9bc690e3 100644 --- a/acconfig.h +++ b/acconfig.h @@ -32,6 +32,12 @@ /* Define if you have GNU's getopt family of functions. */ #undef HAVE_GETOPTLONG +/* Define if you have strstr */ +#undef HAVE_STRSTR + +/* Define if you have vsyslog */ +#undef HAVE_VSYSLOG + /* Leave that blank line there!! Autoheader needs it. If you're adding to this file, keep in mind: diff --git a/configure.in b/configure.in index e98a70e3..72c225ee 100644 --- a/configure.in +++ b/configure.in @@ -80,7 +80,7 @@ AC_SUBST(EXTRASRC) AC_SUBST(EXTRAOBJ) AC_CHECK_FUNCS(tcsetattr stty setsid seteuid gethostbyname res_search herror \ - strrchr strerror setlinebuf syslog snprintf vsnprintf) + strrchr strstr strerror setlinebuf syslog snprintf vsnprintf vsyslog) dnl AC_FUNC_SETVBUF_REVERSED diff --git a/report.c b/report.c index 0c064e01..5b3fdd52 100644 --- a/report.c +++ b/report.c @@ -114,6 +114,27 @@ private_strerror (errnum) Exit with status STATUS if it is nonzero. */ /* VARARGS */ +#if !defined(HAVE_VSYSLOG) && !defined(VA_START) +int vsyslog(priority, message, va_alist) +int priority; +char *message; +va_dcl +{ + va_list args; + + char *string; + + string = (char *)malloc(LINELEN); + + va_start(args); + vsprintf(string, message, args); + va_end(args); + + syslog(priority, string); + free(string); +} +#endif + void #if defined(VA_START) && __STDC__ error (int status, int errnum, const char *message, ...) @@ -415,7 +436,10 @@ error_complete (status, errnum, message, va_alist) exit(status); } else - error (status, errnum, "%s", partial_message); + if (partial_message_size_used != 0) + error (status, errnum, "%s", partial_message); + else + error (status, errnum, ""); } } -- cgit v1.2.3