Skip to content
Permalink
Browse files

Merge pull request #2882 from qlyoung/fix-zlog-deadlock

lib: fix deadlock in log.c
  • Loading branch information...
eqvinox committed Aug 21, 2018
2 parents 5ab5e41 + dce2036 commit f4c28c44868d8ef99a810b995d0dc6df03cc60b7
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/log.c
@@ -868,11 +868,16 @@ int zlog_rotate(void)
save_errno = errno;
umask(oldumask);
if (zl->fp == NULL) {

pthread_mutex_unlock(&loglock);

flog_err_sys(
LIB_ERR_SYSTEM_CALL,
"Log rotate failed: cannot open file %s for append: %s",
zl->filename, safe_strerror(save_errno));
ret = -1;

pthread_mutex_lock(&loglock);
} else {
logfile_fd = fileno(zl->fp);
zl->maxlvl[ZLOG_DEST_FILE] = level;

0 comments on commit f4c28c4

Please sign in to comment.
You can’t perform that action at this time.