test: Test upgrade to ghost messages feature
[notmuch] / hooks.c
diff --git a/hooks.c b/hooks.c
index 44ee41980085c5383c8f9d617fa63764d410110f..662629a951b309021cb86eebfbb0d0cca345e8d0 100644 (file)
--- a/hooks.c
+++ b/hooks.c
@@ -50,6 +50,9 @@ notmuch_run_hook (const char *db_path, const char *hook)
        goto DONE;
     }
 
+    /* Flush any buffered output before forking. */
+    fflush (stdout);
+
     pid = fork();
     if (pid == -1) {
        fprintf (stderr, "Error: %s hook fork failed: %s\n", hook,