summaryrefslogtreecommitdiff
path: root/gtk/updateiconcache.c
diff options
context:
space:
mode:
authorTor Lillqvist <tml@novell.com>2008-05-27 13:03:49 +0000
committerTor Lillqvist <tml@src.gnome.org>2008-05-27 13:03:49 +0000
commitff89f9050dc14b54292185747e72b01f8bc88c86 (patch)
tree9c3b401d9c298d3e7b59244a8a3d3e94eb0ce43f /gtk/updateiconcache.c
parent4449e5032c960e324604ea1b8e482b83c5ad429a (diff)
downloadgdk-pixbuf-ff89f9050dc14b54292185747e72b01f8bc88c86.tar.gz
Use simpler mode for open() on Windows. (No S_I?GRP and S_I?OTH bits are
2008-05-27 Tor Lillqvist <tml@novell.com> * gtk/updateiconcache.c (build_cache): Use simpler mode for open() on Windows. (No S_I?GRP and S_I?OTH bits are defined in <sys/stat.h> on Windows, and the mode used in open() doesn't matter much as there are no rwxrwxrwx bits on Windows anyway.) Open file in binary mode. Passing "b" to fdopen() later isn't enough. svn path=/trunk/; revision=20190
Diffstat (limited to 'gtk/updateiconcache.c')
-rw-r--r--gtk/updateiconcache.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gtk/updateiconcache.c b/gtk/updateiconcache.c
index 1f748fa6a..15fc7ca80 100644
--- a/gtk/updateiconcache.c
+++ b/gtk/updateiconcache.c
@@ -1437,11 +1437,18 @@ build_cache (const gchar *path)
struct utimbuf utime_buf;
GList *directories = NULL;
int fd;
+#ifndef G_OS_WIN32
mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
-
+#else
+ int mode = _S_IWRITE | _S_IREAD;
+#endif
+#ifndef _O_BINARY
+#define _O_BINARY 0
+#endif
+
tmp_cache_path = g_build_filename (path, "."CACHE_NAME, NULL);
- if ((fd = open (tmp_cache_path, O_WRONLY | O_CREAT | O_EXCL | O_TRUNC, mode)) == -1)
+ if ((fd = open (tmp_cache_path, O_WRONLY | O_CREAT | O_EXCL | O_TRUNC | _O_BINARY, mode)) == -1)
{
g_printerr (_("Failed to open file %s : %s\n"), tmp_cache_path, g_strerror (errno));
exit (1);