- if ( ((fd = open(pidfile, O_RDWR|O_CREAT, 0644)) == -1)
- || ((f = fdopen(fd, "r+")) == NULL) ) {
- fprintf(stderr, "Can't open or create %s.\n", pidfile);
+ if ((fd = open(pidfile, O_RDWR|O_CREAT, 0644)) == -1) {
+ return 0;
+ }
+
+ if ((f = fdopen(fd, "r+")) == NULL) {
+ close(fd);