From: Brian Aker Date: Tue, 5 Apr 2011 21:02:02 +0000 (-0700) Subject: Clean up file descriptors that we were leaving on the floor. X-Git-Tag: 0.51~15^2~38 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=0a09f8313ebd710d7565591f3419588a77fa1c38;p=awesomized%2Flibmemcached Clean up file descriptors that we were leaving on the floor. --- diff --git a/libtest/server.c b/libtest/server.c index 6cf05fa1..893a864c 100644 --- a/libtest/server.c +++ b/libtest/server.c @@ -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;