summaryrefslogtreecommitdiff
path: root/src/bin/edje
diff options
context:
space:
mode:
authorStefan Schmidt <s.schmidt@samsung.com>2014-09-10 16:59:40 +0200
committerStefan Schmidt <s.schmidt@samsung.com>2014-09-11 11:55:49 +0200
commit7d8c846d0102850d81a5db15beee6545b8acc1d0 (patch)
treea6b458a2af45e252d4bcfa6b660a929ec9ea8595 /src/bin/edje
parentf55572d79e90fb7355852b4342d8c20526fa3e20 (diff)
edje_watch: Use eina_file_mkstemp() to avoid problems with umask
CID 1039617
Diffstat (limited to 'src/bin/edje')
-rw-r--r--src/bin/edje/edje_watch.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/bin/edje/edje_watch.c b/src/bin/edje/edje_watch.c
index 3ade5f3244..73e2f15b52 100644
--- a/src/bin/edje/edje_watch.c
+++ b/src/bin/edje/edje_watch.c
@@ -17,7 +17,7 @@
17# define WEXITSTATUS(r) r 17# define WEXITSTATUS(r) r
18#endif 18#endif
19 19
20static char watchfile[PATH_MAX]; 20static Eina_Tmpstr *watchfile;
21static char *edje_cc_command = NULL; 21static char *edje_cc_command = NULL;
22static Eina_List *watching = NULL; 22static Eina_List *watching = NULL;
23static Ecore_Timer *timeout = NULL; 23static Ecore_Timer *timeout = NULL;
@@ -102,7 +102,6 @@ some_change(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSE
102int 102int
103main(int argc, char **argv) 103main(int argc, char **argv)
104{ 104{
105 char *watchout;
106 Eina_Strbuf *buf; 105 Eina_Strbuf *buf;
107 int tfd; 106 int tfd;
108 int i; 107 int i;
@@ -112,21 +111,13 @@ main(int argc, char **argv)
112 eio_init(); 111 eio_init();
113 112
114 if (argc < 2) return -1; 113 if (argc < 2) return -1;
115 114
116 ecore_event_handler_add(EIO_MONITOR_FILE_MODIFIED, some_change, NULL); 115 ecore_event_handler_add(EIO_MONITOR_FILE_MODIFIED, some_change, NULL);
117 ecore_event_handler_add(EIO_MONITOR_FILE_CREATED, some_change, NULL); 116 ecore_event_handler_add(EIO_MONITOR_FILE_CREATED, some_change, NULL);
118 ecore_event_handler_add(EIO_MONITOR_FILE_DELETED, some_change, NULL); 117 ecore_event_handler_add(EIO_MONITOR_FILE_DELETED, some_change, NULL);
119 ecore_event_handler_add(EIO_MONITOR_FILE_CLOSED, some_change, NULL); 118 ecore_event_handler_add(EIO_MONITOR_FILE_CLOSED, some_change, NULL);
120 119
121#ifdef HAVE_EVIL 120 tfd = eina_file_mkstemp("edje_watch-tmp-XXXXXX", &watchfile);
122 watchout = (char *)evil_tmpdir_get();
123#else
124 watchout = "/tmp";
125#endif
126
127 snprintf(watchfile, PATH_MAX, "%s/edje_watch-tmp-XXXXXX", watchout);
128
129 tfd = mkstemp(watchfile);
130 if (tfd < 0) return -1; 121 if (tfd < 0) return -1;
131 close(tfd); 122 close(tfd);
132 123
@@ -151,6 +142,7 @@ main(int argc, char **argv)
151 ecore_main_loop_begin(); 142 ecore_main_loop_begin();
152 143
153 unlink(watchfile); 144 unlink(watchfile);
145 eina_tmpstr_del(watchfile);
154 146
155 eio_shutdown(); 147 eio_shutdown();
156 ecore_shutdown(); 148 ecore_shutdown();