]> git.sesse.net Git - plocate/commitdiff
Fix a printing issue when outputting to a block-buffered pipe from a forked child...
authorSteinar H. Gunderson <steinar+nageru@gunderson.no>
Sat, 5 Jun 2021 17:31:12 +0000 (19:31 +0200)
committerSteinar H. Gunderson <steinar+nageru@gunderson.no>
Sat, 5 Jun 2021 17:31:12 +0000 (19:31 +0200)
plocate.cpp

index 9606d2f49db1892be4a145e752262bffaac77e0b..72dbe287434ac848d705f17b02f58929bdd4b16c 100644 (file)
@@ -698,6 +698,7 @@ uint64_t do_search_file_in_child(const vector<Needle> &needles, const std::strin
                        perror("write");
                        _exit(EXIT_FAILURE);
                }
                        perror("write");
                        _exit(EXIT_FAILURE);
                }
+               fflush(stdout);
                _exit(EXIT_SUCCESS);
        }
        case -1:
                _exit(EXIT_SUCCESS);
        }
        case -1: