From c23ddc0aef3493cd7de31a6c43ee985f751a06cf Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 25 Jun 2012 12:55:54 +0200 Subject: cleanup & fix of mini-leak --- tools/pidfile.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/pidfile.c b/tools/pidfile.c index e7744513..e9601232 100644 --- a/tools/pidfile.c +++ b/tools/pidfile.c @@ -125,7 +125,7 @@ int write_pid (char *pidfile) char errStr[1024]; rs_strerror_r(errno, errStr, sizeof(errStr)); printf("Can't write pid , %s.\n", errStr); - close(fd); + fclose(f); return 0; } fflush(f); @@ -135,11 +135,11 @@ int write_pid (char *pidfile) char errStr[1024]; rs_strerror_r(errno, errStr, sizeof(errStr)); printf("Can't unlock pidfile %s, %s.\n", pidfile, errStr); - close(fd); + fclose(f); return 0; } #endif - close(fd); + fclose(f); return pid; } -- cgit