stefan pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=0afd8e8910fcffb73cfc77f6f18c90ae85a6d47e

commit 0afd8e8910fcffb73cfc77f6f18c90ae85a6d47e
Author: Stefan Schmidt <s.schm...@samsung.com>
Date:   Fri Nov 15 16:34:55 2013 +0100

    Avoid umask problem with mkstemp by using eina_file_mkstemp
    
    Instead of handling umask in every mkstemp case we can simply use
    eina_file_mkstemp for this.
    
    CID: 1039806
---
 src/bin/e_import_config_dialog.c       | 4 ++--
 src/modules/wl_screenshot/e_mod_main.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/bin/e_import_config_dialog.c b/src/bin/e_import_config_dialog.c
index 66679f0..3159685 100644
--- a/src/bin/e_import_config_dialog.c
+++ b/src/bin/e_import_config_dialog.c
@@ -50,8 +50,8 @@ _import_edj_gen(E_Import_Config_Dialog *import)
         return;
      }
 
-   strcpy(tmpn, "/tmp/e_bgdlg_new.edc-tmp-XXXXXX");
-   fd = mkstemp(tmpn);
+   strcpy(tmpn, "e_bgdlg_new.edc-tmp-XXXXXX");
+   fd = eina_file_mkstemp(tmpn, NULL);
    if (fd < 0)
      {
         printf("Error Creating tmp file: %s\n", strerror(errno));
diff --git a/src/modules/wl_screenshot/e_mod_main.c 
b/src/modules/wl_screenshot/e_mod_main.c
index b328e3e..a4a3c9a 100644
--- a/src/modules/wl_screenshot/e_mod_main.c
+++ b/src/modules/wl_screenshot/e_mod_main.c
@@ -218,13 +218,13 @@ _cb_handle_global_remove(void *data __UNUSED__, struct 
wl_registry *registry __U
 static struct wl_buffer *
 _create_shm_buffer(struct wl_shm *_shm, int width, int height, void **data_out)
 {
-   char filename[] = "/tmp/wayland-shm-XXXXXX";
+   char filename[] = "wayland-shm-XXXXXX";
    struct wl_shm_pool *pool;
    struct wl_buffer *buffer;
    int fd, size, stride;
    void *data;
 
-   fd = mkstemp(filename);
+   fd = eina_file_mkstemp(filename, NULL);
    if (fd < 0) 
      {
         fprintf(stderr, "open %s failed: %m\n", filename);

-- 


Reply via email to