From: P. J. McDermott Date: Sun, 22 Sep 2013 19:07:10 +0000 (-0400) Subject: Exit on failure to open files. X-Git-Tag: ssic/1.0.0~36 X-Git-Url: https://jxself.org/git/?p=ssic.git;a=commitdiff_plain;h=87ad3d52c3d06311e0fdd87dc654408ee746c45c Exit on failure to open files. --- 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,