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
This commit is contained in:
Stefan Schmidt 2013-11-15 16:34:55 +01:00
parent 56fe7e4e5b
commit 0afd8e8910
2 changed files with 4 additions and 4 deletions

View File

@ -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));

View File

@ -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);