12 Apr
2015
12 Apr
'15
4:01 a.m.
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 <andrew.gregory.8@gmail.com> --- lib/libalpm/log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libalpm/log.c b/lib/libalpm/log.c index fceb96f..c049bf9 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, -- 2.3.5