From 7e06892ad7221e7ab8e40a299638aba2625104be Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Thu, 25 Jul 2002 00:13:38 +0000 Subject: [PATCH] Correctly set the exit code. committer: mfx 1027556018 +0000 --- src/msg.cpp | 1 - src/work.cpp | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/msg.cpp b/src/msg.cpp index ed90dac1..4c90a0e2 100644 --- a/src/msg.cpp +++ b/src/msg.cpp @@ -73,7 +73,6 @@ static void pr_print(bool c, const char *msg) static void pr_error(const char *iname, const char *msg, bool is_warning) { - set_ec(EXIT_ERROR); fflush(stdout); fflush(stderr); char buf[1024]; buf[0] = 0; diff --git a/src/work.cpp b/src/work.cpp index d759e8d3..5adb47ff 100644 --- a/src/work.cpp +++ b/src/work.cpp @@ -280,6 +280,7 @@ void do_files(int i, int argc, char *argv[]) unlink_ofile(oname); if (opt->verbose >= 2 || (opt->verbose >= 1 && !e.isWarning())) printErr(iname,&e); + set_ec(e.isWarning() ? EXIT_WARN : EXIT_ERROR); } catch (const Error &e) { unlink_ofile(oname); printErr(iname,&e);