|
|
@ -866,13 +866,11 @@ bool rotating_log(const char *path, const char *msg) |
|
|
|
} |
|
|
|
} |
|
|
|
if (unlikely(flock(fd, LOCK_EX))) { |
|
|
|
if (unlikely(flock(fd, LOCK_EX))) { |
|
|
|
fclose(fp); |
|
|
|
fclose(fp); |
|
|
|
close(fd); |
|
|
|
|
|
|
|
LOGERR("Failed to flock %s in rotating_log!", filename); |
|
|
|
LOGERR("Failed to flock %s in rotating_log!", filename); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
fprintf(fp, "%s\n", msg); |
|
|
|
fprintf(fp, "%s\n", msg); |
|
|
|
fclose(fp); |
|
|
|
fclose(fp); |
|
|
|
close(fd); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|