forked from enlightenment/efl
embryo: use eina_file_mkstemp.
This commit is contained in:
parent
70f8bd50eb
commit
6e8fe3b03d
|
@ -1,6 +1,7 @@
|
||||||
2013-03-25 Cedric Bail
|
2013-03-25 Cedric Bail
|
||||||
|
|
||||||
* Eina: add portable eina_file_mkstemp().
|
* Eina: add portable eina_file_mkstemp().
|
||||||
|
* Embryo: use eina_file_mkstemp().
|
||||||
|
|
||||||
2013-03-22 Jiyoun Park (Jypark)
|
2013-03-22 Jiyoun Park (Jypark)
|
||||||
|
|
||||||
|
|
1
NEWS
1
NEWS
|
@ -131,6 +131,7 @@ Improvements:
|
||||||
* Evas textblock: Added proper size adjustments for "high" shaped texts.
|
* Evas textblock: Added proper size adjustments for "high" shaped texts.
|
||||||
* Use the right macro to disable fcntl.
|
* Use the right macro to disable fcntl.
|
||||||
* Edje: use Eina_Cow to reduce memory usage.
|
* Edje: use Eina_Cow to reduce memory usage.
|
||||||
|
* Embryo: use eina_file_mkstemp().
|
||||||
|
|
||||||
Fixes:
|
Fixes:
|
||||||
* Fix a memory leak in ecore_con_dns when using ecore_con_server_connect
|
* Fix a memory leak in ecore_con_dns when using ecore_con_server_connect
|
||||||
|
|
|
@ -620,7 +620,6 @@ extern constvalue libname_tab; /* library table (#pragma library "..." syntax) *
|
||||||
extern constvalue *curlibrary; /* current library */
|
extern constvalue *curlibrary; /* current library */
|
||||||
extern symbol *curfunc; /* pointer to current function */
|
extern symbol *curfunc; /* pointer to current function */
|
||||||
extern char *inpfname; /* name of the file currently read from */
|
extern char *inpfname; /* name of the file currently read from */
|
||||||
extern char outfname[]; /* output file name */
|
|
||||||
extern char sc_ctrlchar; /* the control character (or escape character) */
|
extern char sc_ctrlchar; /* the control character (or escape character) */
|
||||||
extern int litidx; /* index to literal table */
|
extern int litidx; /* index to literal table */
|
||||||
extern int litmax; /* current size of the literal table */
|
extern int litmax; /* current size of the literal table */
|
||||||
|
|
|
@ -267,6 +267,7 @@ sc_compile(int argc, char *argv[])
|
||||||
char lcl_ctrlchar;
|
char lcl_ctrlchar;
|
||||||
int lcl_packstr, lcl_needsemicolon, lcl_tabsize;
|
int lcl_packstr, lcl_needsemicolon, lcl_tabsize;
|
||||||
char *tmpdir;
|
char *tmpdir;
|
||||||
|
Eina_Tmpstr *outfname;
|
||||||
|
|
||||||
/* set global variables to their initial value */
|
/* set global variables to their initial value */
|
||||||
binf = NULL;
|
binf = NULL;
|
||||||
|
@ -291,16 +292,7 @@ sc_compile(int argc, char *argv[])
|
||||||
setopt(argc, argv, inpfname, binfname, incfname, reportname);
|
setopt(argc, argv, inpfname, binfname, incfname, reportname);
|
||||||
|
|
||||||
/* open the output file */
|
/* open the output file */
|
||||||
|
fd_out = eina_file_mkstemp("embryo_cc.asm-tmp-XXXXXX", &outfname);
|
||||||
#ifndef HAVE_EVIL
|
|
||||||
tmpdir = getenv("TMPDIR");
|
|
||||||
if (!tmpdir) tmpdir = "/tmp";
|
|
||||||
#else
|
|
||||||
tmpdir = (char *)evil_tmpdir_get();
|
|
||||||
#endif /* ! HAVE_EVIL */
|
|
||||||
|
|
||||||
snprintf(outfname, PATH_MAX, "%s/embryo_cc.asm-tmp-XXXXXX", tmpdir);
|
|
||||||
fd_out = mkstemp(outfname);
|
|
||||||
if (fd_out < 0)
|
if (fd_out < 0)
|
||||||
error(101, outfname);
|
error(101, outfname);
|
||||||
|
|
||||||
|
@ -407,7 +399,8 @@ sc_compile(int argc, char *argv[])
|
||||||
} /* if */
|
} /* if */
|
||||||
if (outf)
|
if (outf)
|
||||||
sc_closeasm(outf);
|
sc_closeasm(outf);
|
||||||
unlink (outfname);
|
unlink(outfname);
|
||||||
|
eina_tmpstr_del(outfname);
|
||||||
if (binf)
|
if (binf)
|
||||||
sc_closebin(binf, errnum != 0);
|
sc_closebin(binf, errnum != 0);
|
||||||
|
|
||||||
|
@ -550,7 +543,6 @@ initglobals(void)
|
||||||
sc_rationaltag = 0; /* assume no support for rational numbers */
|
sc_rationaltag = 0; /* assume no support for rational numbers */
|
||||||
rational_digits = 0; /* number of fractional digits */
|
rational_digits = 0; /* number of fractional digits */
|
||||||
|
|
||||||
outfname[0] = '\0'; /* output file name */
|
|
||||||
inpf = NULL; /* file read from */
|
inpf = NULL; /* file read from */
|
||||||
inpfname = NULL; /* pointer to name of the file currently
|
inpfname = NULL; /* pointer to name of the file currently
|
||||||
* read from */
|
* read from */
|
||||||
|
|
|
@ -45,7 +45,6 @@ constvalue libname_tab = { NULL, "", 0, 0 }; /* library table (#pragma library "
|
||||||
constvalue *curlibrary = NULL; /* current library */
|
constvalue *curlibrary = NULL; /* current library */
|
||||||
symbol *curfunc; /* pointer to current function */
|
symbol *curfunc; /* pointer to current function */
|
||||||
char *inpfname; /* pointer to name of the file currently read from */
|
char *inpfname; /* pointer to name of the file currently read from */
|
||||||
char outfname[PATH_MAX]; /* output file name */
|
|
||||||
char sc_ctrlchar = CTRL_CHAR; /* the control character (or escape character) */
|
char sc_ctrlchar = CTRL_CHAR; /* the control character (or escape character) */
|
||||||
int litidx = 0; /* index to literal table */
|
int litidx = 0; /* index to literal table */
|
||||||
int litmax = sDEF_LITMAX; /* current size of the literal table */
|
int litmax = sDEF_LITMAX; /* current size of the literal table */
|
||||||
|
|
Loading…
Reference in New Issue