htparser: Fixed pidfile-less bug.
[ashd.git] / src / htparser.c
index 17ad93a..0824902 100644 (file)
@@ -486,9 +486,10 @@ int main(int argc, char **argv)
     if(daemonize) {
        daemon(0, 0);
     }
-    if(pidout != NULL)
+    if(pidout != NULL) {
        fprintf(pidout, "%i\n", getpid());
-    fclose(pidout);
+       fclose(pidout);
+    }
     ioloop();
     return(0);
 }