Skip to content

Commit acb74c5

Browse files
author
tymon.huang
committed
fix control flow error
Signed-off-by: tymon.huang <[email protected]>
1 parent 7300fdb commit acb74c5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/util.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -405,10 +405,8 @@ save_pid_file(const char *pf)
405405
int ret = fclose(f);
406406
if (ret == EOF) /* check the return value of fclose */
407407
debug(LOG_ERR, "fclose() on file %s was failed (%s)", pf, strerror(errno));
408-
}
409-
410-
/* fopen return NULL, open file failed */
411-
debug(LOG_ERR, "fopen() on flie %s was failed (%s)", pf, strerror(errno));
408+
} else /* fopen return NULL, open file failed */
409+
debug(LOG_ERR, "fopen() on flie %s was failed (%s)", pf, strerror(errno));
412410
}
413411

414412
return;

0 commit comments

Comments
 (0)