about summary refs log tree commit diff
path: root/nscd/nscd.c
diff options
context:
space:
mode:
Diffstat (limited to 'nscd/nscd.c')
-rw-r--r--nscd/nscd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/nscd/nscd.c b/nscd/nscd.c
index 2941cbdc15..917163af78 100644
--- a/nscd/nscd.c
+++ b/nscd/nscd.c
@@ -491,10 +491,10 @@ write_pid (const char *file)
     return -1;
 
   fprintf (fp, "%d\n", getpid ());
-  if (fflush (fp) || ferror (fp))
-    return -1;
+
+  int result = fflush (fp) || ferror (fp) ? -1 : 0;
 
   fclose (fp);
 
-  return 0;
+  return result;
 }