Use eina_environment_tmp_get()
authorVincent Torri <vincent.torri@gmail.com>
Wed, 22 Jul 2015 05:31:26 +0000 (07:31 +0200)
committerTom Hacohen <tom@stosb.com>
Wed, 22 Jul 2015 08:22:02 +0000 (09:22 +0100)
src/lib/ecore/ecore.c
src/lib/ecore_evas/ecore_evas.c

index f94584d..f121258 100644 (file)
@@ -774,11 +774,7 @@ _ecore_fps_debug_init(void)
    _ecore_fps_debug_init_count++;
    if (_ecore_fps_debug_init_count > 1) return;
 
-#ifndef HAVE_EVIL
-   tmp = "/tmp";
-#else
-   tmp = evil_tmpdir_get ();
-#endif /* HAVE_EVIL */
+   tmp = eina_environment_tmp_get();
    pid = (int)getpid();
    snprintf(buf, sizeof(buf), "%s/.ecore_fps_debug-%i", tmp, pid);
    _ecore_fps_debug_fd = open(buf, O_CREAT | O_TRUNC | O_RDWR, 0644);
@@ -829,16 +825,11 @@ _ecore_fps_debug_shutdown(void)
    if (_ecore_fps_debug_fd >= 0)
      {
         char buf[4096];
-        const char *tmp;
         int pid;
 
-#ifndef HAVE_EVIL
-        tmp = "/tmp";
-#else
-        tmp = (char *)evil_tmpdir_get ();
-#endif /* HAVE_EVIL */
         pid = (int)getpid();
-        snprintf(buf, sizeof(buf), "%s/.ecore_fps_debug-%i", tmp, pid);
+        snprintf(buf, sizeof(buf), "%s/.ecore_fps_debug-%i",
+                 eina_environment_tmp_get(), pid);
         unlink(buf);
         if (_ecore_fps_runtime_mmap)
           {
index 6e49b62..f7fa61f 100644 (file)
@@ -2966,17 +2966,12 @@ EAPI void
 _ecore_evas_fps_debug_init(void)
 {
    char buf[4096];
-   const char *tmp;
 
    _ecore_evas_fps_debug_init_count++;
    if (_ecore_evas_fps_debug_init_count > 1) return;
 
-#ifndef HAVE_EVIL
-   tmp = "/tmp";
-#else
-   tmp = evil_tmpdir_get ();
-#endif /* HAVE_EVIL */
-   snprintf(buf, sizeof(buf), "%s/.ecore_evas_fps_debug-%i", tmp, (int)getpid());
+   snprintf(buf, sizeof(buf), "%s/.ecore_evas_fps_debug-%i",
+            eina_environment_tmp_get(), (int)getpid());
    _ecore_evas_fps_debug_fd = open(buf, O_CREAT | O_TRUNC | O_RDWR, 0644);
    if (_ecore_evas_fps_debug_fd < 0)
      {
@@ -3026,7 +3021,8 @@ _ecore_evas_fps_debug_shutdown(void)
      {
         char buf[4096];
 
-        snprintf(buf, sizeof(buf), "/tmp/.ecore_evas_fps_debug-%i", (int)getpid());
+        snprintf(buf, sizeof(buf), "%s/.ecore_evas_fps_debug-%i",
+                 eina_environment_tmp_get(), (int)getpid());
         unlink(buf);
         if (_ecore_evas_fps_rendertime_mmap)
           {