From bba291a65760f7a78262bebd1e81c1369ac7ebdd Mon Sep 17 00:00:00 2001 From: Zachary Cook Date: Wed, 5 Feb 2014 12:27:27 -0500 Subject: [PATCH] alpm_logaction: Unopenable logfile is an error only when not using syslog This allows syslog to act as a fallback or a standalone logging destination Signed-off-by: Zachary Cook --- 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