*** empty log message ***
This commit is contained in:
@ -1,5 +1,10 @@
|
|||||||
2004-10-21 Matthias Clasen <mclasen@redhat.com>
|
2004-10-21 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkiconcache.c: Include io.h on windows. (#156075,
|
||||||
|
Kazuki IWAMOTO)
|
||||||
|
(_gtk_icon_cache_new_for_path): Don't use MAP_FAILED if we don't
|
||||||
|
have mmap.
|
||||||
|
|
||||||
* gtk/gtkicontheme.c (gtk_icon_theme_has_icon): Implement for
|
* gtk/gtkicontheme.c (gtk_icon_theme_has_icon): Implement for
|
||||||
cached themes.
|
cached themes.
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,10 @@
|
|||||||
2004-10-21 Matthias Clasen <mclasen@redhat.com>
|
2004-10-21 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkiconcache.c: Include io.h on windows. (#156075,
|
||||||
|
Kazuki IWAMOTO)
|
||||||
|
(_gtk_icon_cache_new_for_path): Don't use MAP_FAILED if we don't
|
||||||
|
have mmap.
|
||||||
|
|
||||||
* gtk/gtkicontheme.c (gtk_icon_theme_has_icon): Implement for
|
* gtk/gtkicontheme.c (gtk_icon_theme_has_icon): Implement for
|
||||||
cached themes.
|
cached themes.
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,10 @@
|
|||||||
2004-10-21 Matthias Clasen <mclasen@redhat.com>
|
2004-10-21 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkiconcache.c: Include io.h on windows. (#156075,
|
||||||
|
Kazuki IWAMOTO)
|
||||||
|
(_gtk_icon_cache_new_for_path): Don't use MAP_FAILED if we don't
|
||||||
|
have mmap.
|
||||||
|
|
||||||
* gtk/gtkicontheme.c (gtk_icon_theme_has_icon): Implement for
|
* gtk/gtkicontheme.c (gtk_icon_theme_has_icon): Implement for
|
||||||
cached themes.
|
cached themes.
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,10 @@
|
|||||||
2004-10-21 Matthias Clasen <mclasen@redhat.com>
|
2004-10-21 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkiconcache.c: Include io.h on windows. (#156075,
|
||||||
|
Kazuki IWAMOTO)
|
||||||
|
(_gtk_icon_cache_new_for_path): Don't use MAP_FAILED if we don't
|
||||||
|
have mmap.
|
||||||
|
|
||||||
* gtk/gtkicontheme.c (gtk_icon_theme_has_icon): Implement for
|
* gtk/gtkicontheme.c (gtk_icon_theme_has_icon): Implement for
|
||||||
cached themes.
|
cached themes.
|
||||||
|
|
||||||
|
|||||||
@ -24,7 +24,9 @@
|
|||||||
#ifdef HAVE_MMAP
|
#ifdef HAVE_MMAP
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
#include <io.h>
|
||||||
|
#endif
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
@ -72,12 +74,13 @@ _gtk_icon_cache_unref (GtkIconCache *cache)
|
|||||||
GtkIconCache *
|
GtkIconCache *
|
||||||
_gtk_icon_cache_new_for_path (const gchar *path)
|
_gtk_icon_cache_new_for_path (const gchar *path)
|
||||||
{
|
{
|
||||||
|
GtkIconCache *cache = NULL;
|
||||||
|
#ifdef HAVE_MMAP
|
||||||
gchar *cache_filename;
|
gchar *cache_filename;
|
||||||
gint fd;
|
gint fd;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
struct stat path_st;
|
struct stat path_st;
|
||||||
gchar *buffer = MAP_FAILED;
|
gchar *buffer;
|
||||||
GtkIconCache *cache = NULL;
|
|
||||||
|
|
||||||
if (g_getenv ("GTK_NO_ICON_CACHE"))
|
if (g_getenv ("GTK_NO_ICON_CACHE"))
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -114,9 +117,7 @@ _gtk_icon_cache_new_for_path (const gchar *path)
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_MMAP
|
|
||||||
buffer = (gchar *) mmap (NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
|
buffer = (gchar *) mmap (NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
|
||||||
#endif
|
|
||||||
|
|
||||||
if (buffer == MAP_FAILED)
|
if (buffer == MAP_FAILED)
|
||||||
goto done;
|
goto done;
|
||||||
@ -125,9 +126,7 @@ _gtk_icon_cache_new_for_path (const gchar *path)
|
|||||||
if (GET_UINT16 (buffer, 0) != MAJOR_VERSION ||
|
if (GET_UINT16 (buffer, 0) != MAJOR_VERSION ||
|
||||||
GET_UINT16 (buffer, 2) != MINOR_VERSION)
|
GET_UINT16 (buffer, 2) != MINOR_VERSION)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_MMAP
|
|
||||||
munmap (buffer, st.st_size);
|
munmap (buffer, st.st_size);
|
||||||
#endif
|
|
||||||
GTK_NOTE (ICONTHEME,
|
GTK_NOTE (ICONTHEME,
|
||||||
g_print ("wrong cache version\n"));
|
g_print ("wrong cache version\n"));
|
||||||
goto done;
|
goto done;
|
||||||
@ -144,6 +143,8 @@ _gtk_icon_cache_new_for_path (const gchar *path)
|
|||||||
g_free (cache_filename);
|
g_free (cache_filename);
|
||||||
close (fd);
|
close (fd);
|
||||||
|
|
||||||
|
#endif /* HAVE_MMAP */
|
||||||
|
|
||||||
return cache;
|
return cache;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user