dfu: add error log about failure for partition information 06/256106/1
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Mon, 29 Mar 2021 06:33:42 +0000 (15:33 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Mon, 29 Mar 2021 06:33:44 +0000 (15:33 +0900)
When splitting /hal directory, there can be no files under /hal
directory. Add explicit error log about failure to open device
speicif file.

Change-Id: Icf14faac406035927cec00e4a46595e1d7559edd
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
src/dfu.c

index c7527f7..3e62006 100644 (file)
--- a/src/dfu.c
+++ b/src/dfu.c
@@ -590,8 +590,11 @@ int dfu_init_entry(struct dfu_context *ctx, const char *entry_file)
        int ret;
 
        fp = fopen(entry_file, "r");
-       if (!fp)
+       if (!fp) {
+               fprintf(stderr, "Cannot open partition information: %s\n",
+                       entry_file);
                return -ENOENT;
+       }
 
        while (i < DFU_ENTRY_LIST_MAXLEN && !feof(fp)) {
                if (fgets(buf, 1024, fp) == NULL)