forked from enlightenment/efl
edje_edit: Use eina_file_mkstemp() to avoid problems with umask
CID 1039613
This commit is contained in:
parent
7d8c846d01
commit
a7fb8cd7fe
|
@ -9116,9 +9116,8 @@ _edje_edit_embryo_rebuild(Edje_Edit *eed)
|
||||||
{
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
int fd, size, ret;
|
int fd, size, ret;
|
||||||
const char *tmp_dir;
|
Eina_Tmpstr *tmp_in;
|
||||||
char tmp_in[PATH_MAX];
|
Eina_Tmpstr *tmp_out;
|
||||||
char tmp_out[PATH_MAX];
|
|
||||||
char embryo_cc_path[PATH_MAX] = "";
|
char embryo_cc_path[PATH_MAX] = "";
|
||||||
char inc_path[PATH_MAX] = "";
|
char inc_path[PATH_MAX] = "";
|
||||||
char buf[4096];
|
char buf[4096];
|
||||||
|
@ -9136,12 +9135,6 @@ _edje_edit_embryo_rebuild(Edje_Edit *eed)
|
||||||
free(se);
|
free(se);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_EVIL
|
|
||||||
tmp_dir = evil_tmpdir_get();
|
|
||||||
#else
|
|
||||||
tmp_dir = "/tmp";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
pfx = eina_prefix_new(NULL, /* argv[0] value (optional) */
|
pfx = eina_prefix_new(NULL, /* argv[0] value (optional) */
|
||||||
edje_init, /* an optional symbol to check path of */
|
edje_init, /* an optional symbol to check path of */
|
||||||
"EDJE", /* env var prefix to use (XXX_PREFIX, XXX_BIN_DIR etc. */
|
"EDJE", /* env var prefix to use (XXX_PREFIX, XXX_BIN_DIR etc. */
|
||||||
|
@ -9186,10 +9179,7 @@ _edje_edit_embryo_rebuild(Edje_Edit *eed)
|
||||||
|
|
||||||
eina_prefix_free(pfx);
|
eina_prefix_free(pfx);
|
||||||
|
|
||||||
snprintf(tmp_in, sizeof(tmp_in), "%s/edje_edit.sma-tmp-XXXXXX", tmp_dir);
|
fd = eina_file_mkstemp("edje_edit.sma-tmp-XXXXXX", &tmp_in);
|
||||||
snprintf(tmp_out, sizeof(tmp_out), "%s/edje_edit.amx-tmp-XXXXXX", tmp_dir);
|
|
||||||
|
|
||||||
fd = mkstemp(tmp_in);
|
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
return EINA_FALSE; /* FIXME: report something */
|
return EINA_FALSE; /* FIXME: report something */
|
||||||
|
|
||||||
|
@ -9263,7 +9253,7 @@ _edje_edit_embryo_rebuild(Edje_Edit *eed)
|
||||||
if (!success)
|
if (!success)
|
||||||
goto almost_out;
|
goto almost_out;
|
||||||
|
|
||||||
fd = mkstemp(tmp_out);
|
fd = eina_file_mkstemp("edje_edit.amx-tmp-XXXXXX", &tmp_out);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
{
|
{
|
||||||
success = EINA_FALSE;
|
success = EINA_FALSE;
|
||||||
|
@ -9327,8 +9317,10 @@ the_way_out:
|
||||||
fclose(f);
|
fclose(f);
|
||||||
the_doorway:
|
the_doorway:
|
||||||
unlink(tmp_out);
|
unlink(tmp_out);
|
||||||
|
eina_tmpstr_del(tmp_out);
|
||||||
almost_out:
|
almost_out:
|
||||||
unlink(tmp_in);
|
unlink(tmp_in);
|
||||||
|
eina_tmpstr_del(tmp_in);
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue