mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
Fix segfault on x86_64 when using UseSyslog
Due to differences in handling va_list between i686 and x86_64, this bug can only be seen on x86_64. va_list usage is not allowed but we had been getting away with it. See http://lists.opensuse.org/opensuse-programming/2008-02/msg00005.html for details and explanation. This fixes FS#11096. Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
57393eb730
commit
d8f8a12665
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user