embryo: use eina_file_mkstemp.

This commit is contained in:
Cedric BAIL 2013-03-25 18:44:21 +09:00
parent 70f8bd50eb
commit 6e8fe3b03d
5 changed files with 6 additions and 14 deletions

View File

@ -1,6 +1,7 @@
2013-03-25 Cedric Bail
* Eina: add portable eina_file_mkstemp().
* Embryo: use eina_file_mkstemp().
2013-03-22 Jiyoun Park (Jypark)

1
NEWS
View File

@ -131,6 +131,7 @@ Improvements:
* Evas textblock: Added proper size adjustments for "high" shaped texts.
* Use the right macro to disable fcntl.
* Edje: use Eina_Cow to reduce memory usage.
* Embryo: use eina_file_mkstemp().
Fixes:
* Fix a memory leak in ecore_con_dns when using ecore_con_server_connect

View File

@ -620,7 +620,6 @@ extern constvalue libname_tab; /* library table (#pragma library "..." syntax) *
extern constvalue *curlibrary; /* current library */
extern symbol *curfunc; /* pointer to current function */
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 int litidx; /* index to literal table */
extern int litmax; /* current size of the literal table */

View File

@ -267,6 +267,7 @@ sc_compile(int argc, char *argv[])
char lcl_ctrlchar;
int lcl_packstr, lcl_needsemicolon, lcl_tabsize;
char *tmpdir;
Eina_Tmpstr *outfname;
/* set global variables to their initial value */
binf = NULL;
@ -291,16 +292,7 @@ sc_compile(int argc, char *argv[])
setopt(argc, argv, inpfname, binfname, incfname, reportname);
/* open the output file */
#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);
fd_out = eina_file_mkstemp("embryo_cc.asm-tmp-XXXXXX", &outfname);
if (fd_out < 0)
error(101, outfname);
@ -407,7 +399,8 @@ sc_compile(int argc, char *argv[])
} /* if */
if (outf)
sc_closeasm(outf);
unlink (outfname);
unlink(outfname);
eina_tmpstr_del(outfname);
if (binf)
sc_closebin(binf, errnum != 0);
@ -550,7 +543,6 @@ initglobals(void)
sc_rationaltag = 0; /* assume no support for rational numbers */
rational_digits = 0; /* number of fractional digits */
outfname[0] = '\0'; /* output file name */
inpf = NULL; /* file read from */
inpfname = NULL; /* pointer to name of the file currently
* read from */

View File

@ -45,7 +45,6 @@ constvalue libname_tab = { NULL, "", 0, 0 }; /* library table (#pragma library "
constvalue *curlibrary = NULL; /* current library */
symbol *curfunc; /* pointer to current function */
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) */
int litidx = 0; /* index to literal table */
int litmax = sDEF_LITMAX; /* current size of the literal table */