Upsie, usleep is 10^6 times smaller than sleep
[citadel.git] / citadel / citserver.c
index 42208a7da3d4bee36a9274d6619a316f181010ce..0c8955a8a2b3fb10386b589818e6a3618aff6088 100644 (file)
@@ -216,7 +216,7 @@ void master_cleanup(int exitcode) {
        struct CleanupFunctionHook *fcn;
        static int already_cleaning_up = 0;
 
-       if (already_cleaning_up) while(1) usleep(1000);
+       if (already_cleaning_up) while(1) usleep(1000000);
        already_cleaning_up = 1;
 
        /* Run any cleanup routines registered by loadable modules */
@@ -425,7 +425,7 @@ int is_public_client(void)
                                        }
                                }
                        }
-               fclose(fp);
+               if (fp != NULL) fclose(fp);
                pc_timestamp = time(NULL);
                end_critical_section(S_PUBLIC_CLIENTS);
        }