index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2008-08-08 22:18:00 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2008-08-08 22:18:00 -0500 |
commit | d8f8a126658a25fdad5e9fb00b1b0838a7e93c68 (patch) | |
tree | 43d8fe7ac5545c3705bbabdf1177cbfe480d8f87 /lib | |
parent | 57393eb730641ca912a421b70897fcd289c44b21 (diff) |
-rw-r--r-- | lib/libalpm/util.c | 11 |
diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c index c38dfb5d..2847db7b 100644 --- a/lib/libalpm/util.c +++ b/lib/libalpm/util.c @@ -25,6 +25,7 @@ #include <stdio.h> #include <stdlib.h> +#include <stdarg.h> #include <string.h> #include <fcntl.h> #include <unistd.h> @@ -401,12 +402,18 @@ int _alpm_rmrf(const char *path) return(0); } -int _alpm_logaction(unsigned short usesyslog, FILE *f, const char *fmt, va_list args) +int _alpm_logaction(unsigned short usesyslog, FILE *f, + const char *fmt, va_list args) { int ret = 0; if(usesyslog) { - vsyslog(LOG_WARNING, fmt, args); + /* we can't use a va_list more than once, so we need to copy it + * so we can use the original when calling vfprintf below. */ + va_list args_syslog; + va_copy(args_syslog, args); + vsyslog(LOG_WARNING, fmt, args_syslog); + va_end(args_syslog); } if(f) { |