Close the proper filedescriptor (if it exists).
This commit is contained in:
parent
45fca3c723
commit
ab6f76f6a9
1 changed files with 1 additions and 2 deletions
|
@ -85,12 +85,11 @@ pid_t write_pid (char *pidfile)
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
|
|
||||||
if ((fd = open(pidfile, O_RDWR|O_CREAT, 0644)) == -1) {
|
if ((fd = open(pidfile, O_RDWR|O_CREAT, 0644)) == -1) {
|
||||||
close(fd);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((f = fdopen(fd, "r+")) == NULL) {
|
if ((f = fdopen(fd, "r+")) == NULL) {
|
||||||
fclose(f);
|
close(fd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue