summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
31a6333)
Without this flush, if stdout is block buffered (which will happen if
it's a pipe or a file, for example) and the hook also writes to
stdout, then notmuch new's output will appear *after* the hook output.
This situation may be a little esoteric, but it's good practice to
flush before you fork anyway.
+ /* Flush any buffered output before forking. */
+ fflush (stdout);
+
pid = fork();
if (pid == -1) {
fprintf (stderr, "Error: %s hook fork failed: %s\n", hook,
pid = fork();
if (pid == -1) {
fprintf (stderr, "Error: %s hook fork failed: %s\n", hook,