diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-04-28 15:16:43 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-05-06 17:47:11 -0700 |
commit | 0847b07e89839b430d7eabee8965a4f0c9680256 (patch) | |
tree | 49405e7fa16b5533813c7e8b9f1b168640fb5079 /os | |
parent | 776bcc9e459630c60a4a7f3fdf992589518acb5c (diff) |
print error messages if syslog support is built but disabled
Also ensure we always call va_end() before returning
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/app/xfs/-/merge_requests/7>
Diffstat (limited to 'os')
-rw-r--r-- | os/error.c | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -170,12 +170,13 @@ ErrorF(const char * f, ...) #ifdef USE_SYSLOG if (UseSyslog) { vsyslog(LOG_WARNING, f, args); - return; } -#else - fprintf(stderr, "%s error: ", progname); - vfprintf(stderr, f, args); + else #endif + { + fprintf(stderr, "%s error: ", progname); + vfprintf(stderr, f, args); + } va_end(args); } @@ -187,12 +188,13 @@ FatalError(const char * f, ...) #ifdef USE_SYSLOG if (UseSyslog) { vsyslog(LOG_ERR, f, args); - return; } -#else - fprintf(stderr, "%s fatal error: ", progname); - vfprintf(stderr, f, args); + else #endif + { + fprintf(stderr, "%s fatal error: ", progname); + vfprintf(stderr, f, args); + } va_end(args); abort_server(); /* NOTREACHED */ |