From 544142554ea655482c6389387b3e7eaa8efe2ad5 Mon Sep 17 00:00:00 2001 From: Zachary Cook Date: Wed, 5 Feb 2014 12:27:27 -0500 Subject: [PATCH] alpm_logaction: log to syslog even if logfile is not openable --- lib/libalpm/log.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libalpm/log.c b/lib/libalpm/log.c index d232bcc..19650dd 100644 --- a/lib/libalpm/log.c +++ b/lib/libalpm/log.c @@ -57,8 +57,8 @@ int SYMEXPORT alpm_logaction(alpm_handle_t *handle, const char *prefix, if(fd >= 0) { handle->logstream = fdopen(fd, "a"); } - /* if we couldn't open it, we have an issue */ - if(fd < 0 || handle->logstream == NULL) { + /* if we couldn't open it, we have an issue when not using sylog */ + if((fd < 0 || handle->logstream == NULL) && !handle->usesyslog) { if(errno == EACCES) { handle->pm_errno = ALPM_ERR_BADPERMS; } else if(errno == ENOENT) { -- 1.8.5.3