summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libdaemon/dpid.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libdaemon/dpid.c b/libdaemon/dpid.c
index 39814f1..3e719a7 100644
--- a/libdaemon/dpid.c
+++ b/libdaemon/dpid.c
@@ -236,7 +236,8 @@ int daemon_pid_file_create(void) {
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);