File libdaemon-0.12-bnc449728.diff of Package libdaemon

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;
openSUSE Build Service is sponsored by