summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elm_code_file.c
diff options
context:
space:
mode:
authorMyoungwoon Roy, Kim <myoungwoon.kim@samsung.com>2019-01-30 14:54:36 -0500
committerMike Blumenkrantz <zmike@samsung.com>2019-01-30 15:53:12 -0500
commitf4e5948c0fd819f5259f139a9ec009f4110343a1 (patch)
tree14059d667930fc3a5579276b78f4282a2ebc6a91 /src/lib/elementary/elm_code_file.c
parent40cc1aca0df34ee6c36853a51d6d6761bf3a253f (diff)
elm: fix dereferencing issue and add error handling and remove unreachable codes.
Summary: I had fixed dereferencing issue and added chmod error handling(elm_code_file) I had removed unreachable codes which remains after changing arguments initiallization(efl_ui_win) Test Plan: Run unit test cases Reviewers: eagleeye, Jaehyun_Cho, Hermet, zmike Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7816
Diffstat (limited to '')
-rw-r--r--src/lib/elementary/elm_code_file.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/elementary/elm_code_file.c b/src/lib/elementary/elm_code_file.c
index f0b7861aad..d82a7716bd 100644
--- a/src/lib/elementary/elm_code_file.c
+++ b/src/lib/elementary/elm_code_file.c
@@ -121,6 +121,8 @@ EAPI Elm_Code_File *elm_code_file_new(Elm_Code *code)
121 121
122EAPI Elm_Code_File *elm_code_file_open(Elm_Code *code, const char *path) 122EAPI Elm_Code_File *elm_code_file_open(Elm_Code *code, const char *path)
123{ 123{
124 EINA_SAFETY_ON_NULL_RETURN_VAL(code, NULL);
125
124 Elm_Code_File *ret; 126 Elm_Code_File *ret;
125 Eina_File *file; 127 Eina_File *file;
126 Eina_File_Line *line; 128 Eina_File_Line *line;
@@ -214,7 +216,13 @@ EAPI void elm_code_file_save(Elm_Code_File *file)
214 free(tmp); 216 free(tmp);
215 217
216 if (have_mode) 218 if (have_mode)
217 chmod(path, mode); 219 {
220 if(chmod(path, mode) < 0)
221 {
222 ERR("Error in chmod(%s, %s) - %d(%s)\n", path, mode, errno, strerror(errno));
223 return;
224 }
225 }
218 226
219 if (file->parent) 227 if (file->parent)
220 { 228 {