* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program. If not, see http://www.gnu.org/licenses/ .
+ * along with this program. If not, see https://www.gnu.org/licenses/ .
*
* Author: Jani Nikula <jani@nikula.org>
*/
goto DONE;
}
- pid = fork();
+ /* Flush any buffered output before forking. */
+ fflush (stdout);
+
+ pid = fork ();
if (pid == -1) {
fprintf (stderr, "Error: %s hook fork failed: %s\n", hook,
strerror (errno));
goto DONE;
}
- if (!WIFEXITED (status) || WEXITSTATUS (status)) {
+ if (! WIFEXITED (status) || WEXITSTATUS (status)) {
if (WIFEXITED (status)) {
fprintf (stderr, "Error: %s hook failed with status %d\n",
hook, WEXITSTATUS (status));