From 6de2340db0f7b6632e622c5268d0909247a94758 Mon Sep 17 00:00:00 2001 From: Bob Polis Date: Tue, 6 Feb 2024 11:53:39 +0100 Subject: [PATCH] Add wait for child --- src/conversion.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/conversion.cpp b/src/conversion.cpp index 1209147..37e9242 100644 --- a/src/conversion.cpp +++ b/src/conversion.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include "pixels.hpp" @@ -46,6 +47,9 @@ void convert(const std::string& path) { // try to convert to ppm using ImageMagi throw_if_min1(close(pfd[1])); write_image(std::cout, stdin); + + int exit_status; + throw_if_min1(wait(&exit_status)); break; } }