Clean up file descriptors that we were leaving on the floor.
authorBrian Aker <brian@tangent.org>
Tue, 5 Apr 2011 21:02:02 +0000 (14:02 -0700)
committerBrian Aker <brian@tangent.org>
Tue, 5 Apr 2011 21:02:02 +0000 (14:02 -0700)
libtest/server.c

index 6cf05fa1991be80b7ddb0d995d0cb35453b56d75..893a864c4f816919129913c310f1a6c82309527c 100644 (file)
@@ -121,11 +121,13 @@ void server_startup(server_startup_st *construct)
         int status;
 
         snprintf(construct->pid_file[x], FILENAME_MAX, "/tmp/memcached.pidXXXXXX");
-        if (mkstemp(construct->pid_file[x]) == -1)
+        int fd;
+        if ((fd= mkstemp(construct->pid_file[x])) == -1)
         {
           perror("mkstemp");
           return;
         }
+        close(fd);
 
         {
           char *var;