19 lines
565 B
Diff
19 lines
565 B
Diff
Index: b/libdaemon/dpid.c
|
|
===================================================================
|
|
--- a/libdaemon/dpid.c
|
|
+++ b/libdaemon/dpid.c
|
|
@@ -215,11 +215,12 @@ int daemon_pid_file_create(void) {
|
|
goto finish;
|
|
}
|
|
|
|
snprintf(t, sizeof(t), "%lu\n", (unsigned long) getpid());
|
|
|
|
- if (write(fd, t, l = strlen(t)) != l) {
|
|
+ l = strlen(t);
|
|
+ if (write(fd, t, l) != l) {
|
|
int saved_errno = errno;
|
|
daemon_log(LOG_WARNING, "write(): %s", strerror(errno));
|
|
unlink(fn);
|
|
errno = saved_errno;
|
|
goto finish;
|