From e4af5e3c9787a37103e71c7814564435ec241d4c Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Sun, 12 Apr 2015 00:01:21 -0400 Subject: alpm_logaction: check logfile before opening valgrind does not like calling open(NULL, ...). This also makes the return value 0 if logfile has not been set. Signed-off-by: Andrew Gregory Signed-off-by: Allan McRae --- lib/libalpm/log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/libalpm/log.c b/lib/libalpm/log.c index fceb96f4..c049bf90 100644 --- a/lib/libalpm/log.c +++ b/lib/libalpm/log.c @@ -53,7 +53,7 @@ int SYMEXPORT alpm_logaction(alpm_handle_t *handle, const char *prefix, } /* check if the logstream is open already, opening it if needed */ - if(handle->logstream == NULL) { + if(handle->logstream == NULL && handle->logfile != NULL) { int fd; do { fd = open(handle->logfile, O_WRONLY | O_APPEND | O_CREAT | O_CLOEXEC, -- cgit v1.2.3-24-g4f1b