aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/efreet
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2015-07-22 05:44:50 +0200
committerTom Hacohen <tom@stosb.com>2015-07-22 09:22:02 +0100
commiteeb259303f720c1981efa52d5e1a6fba6708aff6 (patch)
tree55314aadd6df87dbfd78ff11a6cfdcd5f13ddd3a /src/bin/efreet
parentecore-x: send last event time along with generic Ecore_X_Event_Client_Message (diff)
downloadefl-eeb259303f720c1981efa52d5e1a6fba6708aff6.tar.gz
Efreet: use eina_file_mkstemp() instead of mkstemp in efreetd.c
Diffstat (limited to 'src/bin/efreet')
-rw-r--r--src/bin/efreet/efreetd.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/bin/efreet/efreetd.c b/src/bin/efreet/efreetd.c
index ffb15a09c3..aed2996654 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)