Skip to content

Commit 5c5d832

Browse files
committed
fix warning in quiz/daemon
1 parent 3c8ef81 commit 5c5d832

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

quiz/daemon.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ bool is_running(const char *pid_file)
102102
int n = sprintf(buf, "%ld", (long)getpid());
103103
if (n > 0) {
104104
buf[n] = '\n';
105-
write(fd, buf, n + 1);
105+
int n1 = write(fd, buf, n + 1);
106+
if (n1 != n) {
107+
log_err("write pid file failed", strerror(errno));
108+
}
106109
}
107110
// Do not close the file, or the lock is released.
108111
return false;

0 commit comments

Comments
 (0)