forked from enlightenment/enlightenment
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:
parent
56fe7e4e5b
commit
0afd8e8910
|
@ -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));
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue