Correctly set the exit code.
committer: mfx <mfx> 1027556018 +0000
This commit is contained in:
@@ -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)
|
static void pr_error(const char *iname, const char *msg, bool is_warning)
|
||||||
{
|
{
|
||||||
set_ec(EXIT_ERROR);
|
|
||||||
fflush(stdout); fflush(stderr);
|
fflush(stdout); fflush(stderr);
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
buf[0] = 0;
|
buf[0] = 0;
|
||||||
|
|||||||
@@ -280,6 +280,7 @@ void do_files(int i, int argc, char *argv[])
|
|||||||
unlink_ofile(oname);
|
unlink_ofile(oname);
|
||||||
if (opt->verbose >= 2 || (opt->verbose >= 1 && !e.isWarning()))
|
if (opt->verbose >= 2 || (opt->verbose >= 1 && !e.isWarning()))
|
||||||
printErr(iname,&e);
|
printErr(iname,&e);
|
||||||
|
set_ec(e.isWarning() ? EXIT_WARN : EXIT_ERROR);
|
||||||
} catch (const Error &e) {
|
} catch (const Error &e) {
|
||||||
unlink_ofile(oname);
|
unlink_ofile(oname);
|
||||||
printErr(iname,&e);
|
printErr(iname,&e);
|
||||||
|
|||||||
Reference in New Issue
Block a user