--- a/src/AwkHandler.h Thu May 23 23:35:52 2019 +0200
+++ b/src/AwkHandler.h Sat May 25 11:36:31 2019 +0200
@@ -133,9 +133,11 @@
void cleanUp() {
if (awkInputWriterFD >= 0) {
closeOrThrow(awkInputWriterFD);
- // FIXME: check exit codes
- __pid_t waitResult1 = wait(NULL);
- __pid_t waitResult2 = wait(NULL);
+ int error1;
+ int error2;
+ __pid_t waitPID1 = wait(&error1);
+ __pid_t waitPID2 = wait(&error2);
+ if (error1 || error2) throw cli::RelpipeCLIException(L"The child process returned an error exit code.", cli::CLI::EXIT_CODE_UNEXPECTED_ERROR); // TODO: better exceptions?
awkInputWriterFD = -1;
}