mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
binpac: pac_scan: Exit with failure for include errors
Elsewhere (zeek/zeek#2482), it was observed that when binpac encounters include failures, it still exits with 0 indicating success. Subsequent compilation of the produced .h and .cc files likely fails. Exit with 1 on include errors to make pin pointing issues easier by having make/ninja stop earlier.
This commit is contained in:
parent
d21f99ef2b
commit
60265b8ce7
1 changed files with 2 additions and 3 deletions
|
@ -337,8 +337,7 @@ void switch_to_file(const char *filename)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s:%d: error: cannot include file \"%s\"\n",
|
fprintf(stderr, "%s:%d: error: cannot include file \"%s\"\n",
|
||||||
input_filename.c_str(), line_number,filename);
|
input_filename.c_str(), line_number,filename);
|
||||||
--include_stack_ptr;
|
exit( 1 );
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
yyin = fp;
|
yyin = fp;
|
||||||
|
@ -367,7 +366,7 @@ void include_file(const char *filename)
|
||||||
fprintf(stderr, "%s:%d error: cannot include file \"%s\": %s\n",
|
fprintf(stderr, "%s:%d error: cannot include file \"%s\": %s\n",
|
||||||
input_filename.c_str(), line_number, filename,
|
input_filename.c_str(), line_number, filename,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
return;
|
exit( 1 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue