Close the proper filedescriptor (if it exists).

This commit is contained in:
Guus Sliepen 2007-02-14 09:32:16 +00:00
parent 45fca3c723
commit ab6f76f6a9

View file

@ -85,12 +85,11 @@ pid_t write_pid (char *pidfile)
pid_t pid;
if ((fd = open(pidfile, O_RDWR|O_CREAT, 0644)) == -1) {
close(fd);
return 0;
}
if ((f = fdopen(fd, "r+")) == NULL) {
fclose(f);
close(fd);
return 0;
}