Skip to content

Commit

Permalink
Minor fixes to make Coverity happy.
Browse files Browse the repository at this point in the history
The logfile API is a bit weird with respect to mutexes.  It's
intended reply with mutexes held
  • Loading branch information
alandekok committed Apr 14, 2014
1 parent a026b97 commit 226a037
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/log.c
Expand Up @@ -776,6 +776,7 @@ static int _logfile_free(fr_logfile_t *lf)

PTHREAD_MUTEX_LOCK(&lf->entries[i].mutex);
close(lf->entries[i].fd);
PTHREAD_MUTEX_UNLOCK(&lf->entries[i].mutex);
#ifdef HAVE_PTHREAD_H
pthread_mutex_destroy(&lf->entries[i].mutex);
#endif
Expand Down Expand Up @@ -1068,7 +1069,7 @@ int fr_logfile_close(fr_logfile_t *lf, int fd)
*/
if (lf->entries[i].fd == fd) {
lseek(lf->entries[i].fd, 0, SEEK_SET);
rad_unlockfd(lf->entries[i].fd, 0);
(void) rad_unlockfd(lf->entries[i].fd, 0);

PTHREAD_MUTEX_UNLOCK(&(lf->entries[i].mutex));
PTHREAD_MUTEX_UNLOCK(&(lf->mutex));
Expand Down

0 comments on commit 226a037

Please sign in to comment.