summaryrefslogtreecommitdiff
blob: 25ae94b9fb85b8dbd8227eaf1c7a13e802460f66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
diff --git a/freshclam/freshclam.c b/freshclam/freshclam.c
index 8db3b8001..8cde8c9a8 100644
--- a/freshclam/freshclam.c
+++ b/freshclam/freshclam.c
@@ -280,6 +280,14 @@ fc_error_t download_complete_callback(const char *dbFilename, void *context)
                 goto done;
             }
         } else {
+            /*
+             * Attempt to test database in a child process.
+             */
+
+            /* We need to be able to wait for the child process ourselves.
+             * We'll re-enable wait in the global handler when we're done. */
+            g_sigchildWait = 0;
+
             switch (pid = fork()) {
                 case -1: {
                     /*
@@ -391,6 +399,7 @@ done:
         logg("!Database test FAILED.\n");
     }
 
+    /* Re-enable the global handler's child process wait */
     g_sigchildWait = 1;
 
     return status;