Skip to content

Commit 522d35a

Browse files
authored
Merge pull request #996 from ldorau/Print_more_info_when_open_fails_in_the_custom_file_provider_example
Print more info when open() fails in the custom_file_provider example
2 parents 95861f3 + 202984e commit 522d35a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/custom_file_provider/custom_file_provider.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ static umf_result_t file_init(void *params, void **provider) {
6262
// Open the file
6363
file_provider->fd = open(file_params->filename, O_RDWR | O_CREAT, 0666);
6464
if (file_provider->fd < 0) {
65-
perror("Failed to open file");
65+
perror("open()");
66+
fprintf(stderr, "Failed to open the file: %s\n", file_params->filename);
6667
ret = UMF_RESULT_ERROR_INVALID_ARGUMENT;
6768
goto cleanup_malloc;
6869
}

0 commit comments

Comments
 (0)