summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Schmidt <s.schmidt@samsung.com>2013-11-15 16:34:55 +0100
committerStefan Schmidt <s.schmidt@samsung.com>2013-11-15 16:34:55 +0100
commit0afd8e8910fcffb73cfc77f6f18c90ae85a6d47e (patch)
treebfe2ad356ce50206ce3c59f09d18b11d91638a48
parent56fe7e4e5b6879541fd3109ca2f99bfcde2b6388 (diff)
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
-rw-r--r--src/bin/e_import_config_dialog.c4
-rw-r--r--src/modules/wl_screenshot/e_mod_main.c4
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 66679f002..31596853a 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)
50 return; 50 return;
51 } 51 }
52 52
53 strcpy(tmpn, "/tmp/e_bgdlg_new.edc-tmp-XXXXXX"); 53 strcpy(tmpn, "e_bgdlg_new.edc-tmp-XXXXXX");
54 fd = mkstemp(tmpn); 54 fd = eina_file_mkstemp(tmpn, NULL);
55 if (fd < 0) 55 if (fd < 0)
56 { 56 {
57 printf("Error Creating tmp file: %s\n", strerror(errno)); 57 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 b328e3eda..a4a3c9ab9 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
218static struct wl_buffer * 218static struct wl_buffer *
219_create_shm_buffer(struct wl_shm *_shm, int width, int height, void **data_out) 219_create_shm_buffer(struct wl_shm *_shm, int width, int height, void **data_out)
220{ 220{
221 char filename[] = "/tmp/wayland-shm-XXXXXX"; 221 char filename[] = "wayland-shm-XXXXXX";
222 struct wl_shm_pool *pool; 222 struct wl_shm_pool *pool;
223 struct wl_buffer *buffer; 223 struct wl_buffer *buffer;
224 int fd, size, stride; 224 int fd, size, stride;
225 void *data; 225 void *data;
226 226
227 fd = mkstemp(filename); 227 fd = eina_file_mkstemp(filename, NULL);
228 if (fd < 0) 228 if (fd < 0)
229 { 229 {
230 fprintf(stderr, "open %s failed: %m\n", filename); 230 fprintf(stderr, "open %s failed: %m\n", filename);