From 56ccb52381f611049ab876ee57ec76a5bf6dd563 Mon Sep 17 00:00:00 2001 From: "jiyong.min" Date: Thu, 30 May 2019 09:33:59 +0900 Subject: [PATCH] Change the valid permission to encode image - Because encoded file do not exist before encoding, open/fopen return error for RD(read) permission. Change-Id: I24ab95e5bab5edaed62c55b0c95c8495473299d8 --- src/image_util_encode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/image_util_encode.c b/src/image_util_encode.c index 6aef251..5d35009 100644 --- a/src/image_util_encode.c +++ b/src/image_util_encode.c @@ -365,7 +365,7 @@ static int __image_util_encode_run_to_file(image_util_encode_h handle, image_uti image_util_retvm_if(!_handle, IMAGE_UTIL_ERROR_INVALID_PARAMETER, "Invalid handle"); image_util_retvm_if(!image, IMAGE_UTIL_ERROR_INVALID_PARAMETER, "Invalid image"); - ret = _check_valid_file(file_path, O_RDWR); + ret = _check_valid_file(file_path, O_WRONLY); image_util_retvm_if(ret != IMAGE_UTIL_ERROR_NONE, ret, "_check_valid_file failed (%d)", ret); image_util_sec_debug("Image type [%d]. Save to file_path [%s]", _handle->image_type, file_path); @@ -575,7 +575,7 @@ int image_util_encode_run_async_to_file(image_util_encode_h handle, image_util_i image_util_retvm_if(!_handle, IMAGE_UTIL_ERROR_INVALID_PARAMETER, "Invalid handle"); image_util_retvm_if(!image, IMAGE_UTIL_ERROR_INVALID_PARAMETER, "Invalid image"); image_util_retvm_if(!completed_cb, IMAGE_UTIL_ERROR_INVALID_PARAMETER, "Invalid completed_cb"); - ret = _check_valid_file(file_path, O_RDWR); + ret = _check_valid_file(file_path, O_WRONLY); image_util_retvm_if(ret != IMAGE_UTIL_ERROR_NONE, ret, "_check_valid_file failed (%d)", ret); image_util_fenter(); -- 2.7.4