Add perror() to fopen: more info for user.
This commit is contained in:
parent
1390e577fa
commit
83897d8474
|
|
@ -1542,6 +1542,7 @@ com_alter_mod(wordlist *wl)
|
|||
|
||||
if (modfile == NULL) {
|
||||
fprintf(cp_err, "Warning: Could not open file %s, altermod ignored\n", filename);
|
||||
perror(" Cause: ");
|
||||
tfree(input);
|
||||
tfree(filename);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -583,6 +583,7 @@ static struct library *read_a_lib(const char *y, const char *dir_name)
|
|||
|
||||
if (!newfp) {
|
||||
fprintf(cp_err, "Error: Could not open library file %s\n", y);
|
||||
perror(" Cause: ");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -1564,6 +1565,7 @@ static struct inp_read_t inp_read(FILE* fp, int call_depth, const char* dir_name
|
|||
else
|
||||
fprintf(cp_err, " While reading %s\n", y_resolved);
|
||||
}
|
||||
perror(" Cause: ");
|
||||
tfree(buffer); /* allocated by readline() above */
|
||||
controlled_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -255,8 +255,10 @@ do_measure(
|
|||
|
||||
if (cp_getvar("measoutfile", CP_STRING, out_file, sizeof(out_file))) {
|
||||
measout = fopen(out_file, "w");
|
||||
if (!measout)
|
||||
if (!measout) {
|
||||
fprintf(stderr, " Warning: Could not open file %s\n", out_file);
|
||||
perror(" Cause: ");
|
||||
}
|
||||
}
|
||||
|
||||
/* Evaluating the linked list of .meas cards, assembled from the input deck
|
||||
|
|
|
|||
Loading…
Reference in New Issue