diff options
Diffstat (limited to 'src/lib/elua')
-rw-r--r-- | src/lib/elua/cache.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/lib/elua/cache.c b/src/lib/elua/cache.c index d03d9bfb94..67268a4a2b 100644 --- a/src/lib/elua/cache.c +++ b/src/lib/elua/cache.c | |||
@@ -60,24 +60,16 @@ static FILE * | |||
60 | bc_tmp_open(const char *fname, char *buf, size_t buflen) | 60 | bc_tmp_open(const char *fname, char *buf, size_t buflen) |
61 | { | 61 | { |
62 | int fd; | 62 | int fd; |
63 | #ifndef _WIN32 | 63 | /* FIXME: use ecore_file_file_get() ? */ |
64 | mode_t old_umask; | ||
65 | #endif | ||
66 | char *fs = strrchr(fname, '/'), *bs = strrchr(fname, '\\'); | 64 | char *fs = strrchr(fname, '/'), *bs = strrchr(fname, '\\'); |
67 | if (!fs && !bs) | 65 | if (!fs && !bs) |
68 | snprintf(buf, buflen, "./XXXXXX"); | 66 | snprintf(buf, buflen, "./XXXXXX.cache"); |
69 | else | 67 | else |
70 | { | 68 | { |
71 | char *ss = (fs > bs) ? fs : bs; | 69 | char *ss = (fs > bs) ? fs : bs; |
72 | snprintf(buf, buflen, "%.*sXXXXXX", (int)(ss - fname + 1), fname); | 70 | snprintf(buf, buflen, "%.*sXXXXXX.cache", (int)(ss - fname + 1), fname); |
73 | } | 71 | } |
74 | #ifndef _WIN32 | 72 | fd = eina_file_mkstemp(buf, NULL); |
75 | old_umask = umask(S_IRWXG|S_IRWXO); | ||
76 | #endif | ||
77 | fd = mkstemp(buf); | ||
78 | #ifndef _WIN32 | ||
79 | umask(old_umask); | ||
80 | #endif | ||
81 | if (fd < 0) | 73 | if (fd < 0) |
82 | return NULL; | 74 | return NULL; |
83 | return fdopen(fd, "wb"); | 75 | return fdopen(fd, "wb"); |