Browse Source

Add perror() to fopen: more info for user.

pre-master-46
Holger Vogt 5 months ago
parent
commit
83897d8474
  1. 1
      src/frontend/device.c
  2. 2
      src/frontend/inpcom.c
  3. 4
      src/frontend/measure.c

1
src/frontend/device.c

@ -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;

2
src/frontend/inpcom.c

@ -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);
}

4
src/frontend/measure.c

@ -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…
Cancel
Save