forked from enlightenment/efl
elm/code: check save file attrs after opening
ensure that they haven't changed between time of check and time of open CID 1396966 Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D10440
This commit is contained in:
parent
b2ee3ad748
commit
cdacc790f7
|
@ -185,18 +185,17 @@ EAPI void elm_code_file_save(Elm_Code_File *file)
|
|||
tmp = _elm_code_file_tmp_path_get(file);
|
||||
crchars = elm_code_file_line_ending_chars_get(file, &crlength);
|
||||
|
||||
if (stat(path, &st) != -1)
|
||||
{
|
||||
mode = st.st_mode;
|
||||
have_mode = EINA_TRUE;
|
||||
}
|
||||
|
||||
out = fopen(tmp, "w");
|
||||
if (out == NULL)
|
||||
{
|
||||
free(tmp);
|
||||
return;
|
||||
}
|
||||
if (fstat(fileno(out), &st) != -1)
|
||||
{
|
||||
mode = st.st_mode;
|
||||
have_mode = EINA_TRUE;
|
||||
}
|
||||
|
||||
EINA_LIST_FOREACH(file->lines, item, line_item)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue