- in = sr_input_scan_file(opt_input_file);
- /* That worked, reopen the file for reading. */
- fd = open(opt_input_file, O_RDONLY);
+ if (sr_input_scan_file(opt_input_file, &in) == SR_OK) {
+ /* That worked, reopen the file for reading. */
+ fd = open(opt_input_file, O_RDONLY);
+ }