diff --git a/src/util/virlog.c b/src/util/virlog.c index 7b584f8e37..7933e1a7a0 100644 --- a/src/util/virlog.c +++ b/src/util/virlog.c @@ -750,8 +750,10 @@ virLogNewOutputToFile(virLogPriority priority, virLogOutputPtr ret = NULL; fd = open(file, O_CREAT | O_APPEND | O_WRONLY, S_IRUSR | S_IWUSR); - if (fd < 0) + if (fd < 0) { + virReportSystemError(errno, _("failed to open %s"), file); return NULL; + } if (!(ret = virLogOutputNew(virLogOutputToFd, virLogCloseFd, (void *)(intptr_t)fd,