gtk+ r20190 - in trunk: . gtk



Author: tml
Date: Tue May 27 13:03:49 2008
New Revision: 20190
URL: http://svn.gnome.org/viewvc/gtk+?rev=20190&view=rev

Log:
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.



Modified:
   trunk/ChangeLog
   trunk/gtk/updateiconcache.c

Modified: trunk/gtk/updateiconcache.c
==============================================================================
--- trunk/gtk/updateiconcache.c	(original)
+++ trunk/gtk/updateiconcache.c	Tue May 27 13:03:49 2008
@@ -1437,11 +1437,18 @@
   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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]