Make perror("fopen") messages distinct

This commit is contained in:
Geoffrey D. Bennett
2025-02-20 23:41:36 +10:30
parent 78e2d9642f
commit 64d9f8173a
2 changed files with 3 additions and 3 deletions

View File

@@ -72,7 +72,7 @@ struct scarlett2_firmware_header *scarlett2_read_firmware_header(
) {
FILE *file = fopen(fn, "rb");
if (!file) {
perror("fopen");
perror("fopen firmware header");
fprintf(stderr, "Unable to open %s\n", fn);
return NULL;
}
@@ -91,7 +91,7 @@ struct scarlett2_firmware_header *scarlett2_read_firmware_header(
struct scarlett2_firmware_file *scarlett2_read_firmware_file(const char *fn) {
FILE *file = fopen(fn, "rb");
if (!file) {
perror("fopen");
perror("fopen firmware file");
fprintf(stderr, "Unable to open %s\n", fn);
return NULL;
}

View File

@@ -46,7 +46,7 @@ static int get_sample_rate(struct sample_rate *data) {
FILE *file = fopen(data->path, "r");
if (!file) {
perror("fopen");
perror("fopen /proc/asound/cardN/stream0");
return 0;
}