Browse Source

Exit when executing the input fails,

if -o option (log file) is set and not in interactive mode.
Enables running the paranoia suite without hanging if
something goes wrong.
pre-master-46
Holger Vogt 4 years ago
parent
commit
6b83a57a18
  1. 8
      src/main.c

8
src/main.c

@ -1091,13 +1091,17 @@ int main(int argc, char **argv)
cp_nocc = FALSE; cp_nocc = FALSE;
} }
#ifndef HAS_WINGUI
if ((iflag || istty) && !ft_batchmode) { if ((iflag || istty) && !ft_batchmode) {
/* Enable interactive prompting. */ /* Enable interactive prompting. */
#else
if (iflag && !ft_batchmode) {
#endif
bool x_true = TRUE; bool x_true = TRUE;
cp_vset("interactive", CP_BOOL, &x_true); cp_vset("interactive", CP_BOOL, &x_true);
} }
if (ft_servermode) { /* in server no init file */ if (ft_servermode) { /* in server no init file */
readinit = FALSE; readinit = FALSE;
} }
@ -1322,6 +1326,8 @@ int main(int argc, char **argv)
/* Copy the input file name for becoming another file search path */ /* Copy the input file name for becoming another file search path */
if (inp_spsource(tempfile, FALSE, dname, FALSE) != 0) { if (inp_spsource(tempfile, FALSE, dname, FALSE) != 0) {
fprintf(stderr, " Simulation interrupted due to error!\n\n"); fprintf(stderr, " Simulation interrupted due to error!\n\n");
if (oflag && !cp_getvar("interactive", CP_BOOL, NULL, 0))
exit(EXIT_BAD);
} }
tfree(dname); tfree(dname);
gotone = TRUE; gotone = TRUE;

Loading…
Cancel
Save