From 202984eb90da6f18b34bc96d72539167886c7885 Mon Sep 17 00:00:00 2001 From: Lukasz Dorau Date: Tue, 17 Dec 2024 09:26:47 +0100 Subject: [PATCH] Print more info when open() fails in the custom_file_provider example Signed-off-by: Lukasz Dorau --- examples/custom_file_provider/custom_file_provider.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/custom_file_provider/custom_file_provider.c b/examples/custom_file_provider/custom_file_provider.c index ad897fe5ea..b17fdc0f08 100644 --- a/examples/custom_file_provider/custom_file_provider.c +++ b/examples/custom_file_provider/custom_file_provider.c @@ -62,7 +62,8 @@ static umf_result_t file_init(void *params, void **provider) { // Open the file file_provider->fd = open(file_params->filename, O_RDWR | O_CREAT, 0666); if (file_provider->fd < 0) { - perror("Failed to open file"); + perror("open()"); + fprintf(stderr, "Failed to open the file: %s\n", file_params->filename); ret = UMF_RESULT_ERROR_INVALID_ARGUMENT; goto cleanup_malloc; }