No more try to write log file without recovery image path 37/246237/1 submit/tizen/20201028.080257
authorKichan Kwon <k_c.kwon@samsung.com>
Tue, 27 Oct 2020 07:25:05 +0000 (16:25 +0900)
committerKichan Kwon <k_c.kwon@samsung.com>
Tue, 27 Oct 2020 07:25:05 +0000 (16:25 +0900)
Change-Id: I17eed3fe03f1df0638529d958a36ee2b6bb6995b
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
src/system-recovery.c

index a49be2e..dda19cb 100644 (file)
@@ -43,6 +43,8 @@ static int write_log_file(void)
        int ret;
        char path[128];
 
+       ASSERT_RETV(recovery_image_path[0], EINVAL, "Recovery image path is empty");
+
        snprintf(path, sizeof(path), "%s/%s", dirname(recovery_image_path), LOG_FILE_BASENAME);
        log_fd = creat(path, 0644);
        ASSERT_RETV(log_fd != -1, errno, "Failed to open log file (%d)", errno);