diff options
author | P. J. McDermott <pjm@nac.net> | 2013-09-22 15:07:10 (EDT) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2013-09-22 15:07:10 (EDT) |
commit | 87ad3d52c3d06311e0fdd87dc654408ee746c45c (patch) | |
tree | 3164d73cf9032e947f875101a7cbbca187559c1b | |
parent | ffb38283618851c4697a359824da679780c4564e (diff) | |
download | ssic-87ad3d52c3d06311e0fdd87dc654408ee746c45c.zip ssic-87ad3d52c3d06311e0fdd87dc654408ee746c45c.tar.gz ssic-87ad3d52c3d06311e0fdd87dc654408ee746c45c.tar.bz2 |
Exit on failure to open files.
-rw-r--r-- | src/ssic.pl | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ssic.pl b/src/ssic.pl index 80e2071..553f83d 100644 --- a/src/ssic.pl +++ b/src/ssic.pl @@ -112,8 +112,12 @@ sub compile error(4, "Input and output files are equal\n"); } - open($input_fh, "<", $input); - open($output_fh, ">", $output); + if (not open($input_fh, "<", $input)) { + error(4, "%s: %s\n", $input, $!); + } + if (not open($output_fh, ">", $output)) { + error(4, "%s: %s\n", $output, $!); + } %ENV = ( "DOCUMENT_NAME" => $input, |