tasn pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=eeb259303f720c1981efa52d5e1a6fba6708aff6

commit eeb259303f720c1981efa52d5e1a6fba6708aff6
Author: Vincent Torri <vincent.to...@gmail.com>
Date:   Wed Jul 22 05:44:50 2015 +0200

    Efreet: use eina_file_mkstemp() instead of mkstemp in efreetd.c
---
 src/bin/efreet/efreetd.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/bin/efreet/efreetd.c b/src/bin/efreet/efreetd.c
index ffb15a0..aed2996 100644
--- a/src/bin/efreet/efreetd.c
+++ b/src/bin/efreet/efreetd.c
@@ -29,7 +29,6 @@ main(int argc, char *argv[])
    char path[PATH_MAX];
    FILE *log;
    int fd;
-   mode_t um;
 
 #ifdef HAVE_SYS_RESOURCE_H
    setpriority(PRIO_PROCESS, 0, 19);
@@ -37,19 +36,19 @@ main(int argc, char *argv[])
    SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS);
 #endif
 
-   strcpy(path, "/tmp/efreetd_XXXXXX");
-   um = umask(S_IRWXG | S_IRWXO);
-   fd = mkstemp(path);
-   umask(um);
+   if (!eina_init()) return 1;
+
+   snprintf(path, sizeof(path), "efreetd_XXXXXX");
+   fd = eina_file_mkstemp(path, NULL);
    if (fd < 0)
      {
         perror("mkstemp");
-        return 1;
+        goto ecore_error;
      }
    log = fdopen(fd, "wb");
-   if (!log) return 1;
+   if (!log)
+     goto ecore_error;
 
-   if (!eina_init()) return 1;
    eina_log_print_cb_set(eina_log_print_cb_file, log);
    efreetd_log_dom = eina_log_domain_register("efreetd", 
EFREETD_DEFAULT_LOG_COLOR);
    if (efreetd_log_dom < 0)

-- 


Reply via email to