summaryrefslogtreecommitdiffstats
path: root/devel/gnome-vfs
diff options
context:
space:
mode:
authormarcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059>2005-08-28 14:12:29 +0800
committermarcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059>2005-08-28 14:12:29 +0800
commit83bcd024ad735dfa369fa4506ac54bed4611dc58 (patch)
tree12a0fd5b27d683f4e0ca14e154830e82e4e673ca /devel/gnome-vfs
parenta203cafa8f13e657422b8476bc88dab152f1cd63 (diff)
downloadmarcuscom-ports-83bcd024ad735dfa369fa4506ac54bed4611dc58.tar
marcuscom-ports-83bcd024ad735dfa369fa4506ac54bed4611dc58.tar.gz
marcuscom-ports-83bcd024ad735dfa369fa4506ac54bed4611dc58.tar.bz2
marcuscom-ports-83bcd024ad735dfa369fa4506ac54bed4611dc58.tar.lz
marcuscom-ports-83bcd024ad735dfa369fa4506ac54bed4611dc58.tar.xz
marcuscom-ports-83bcd024ad735dfa369fa4506ac54bed4611dc58.tar.zst
marcuscom-ports-83bcd024ad735dfa369fa4506ac54bed4611dc58.zip
Lock down the xdgmime API a bit more to avoid reentrancy problems.
git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@4648 df743ca5-7f9a-e211-a948-0013205c9059
Diffstat (limited to 'devel/gnome-vfs')
-rw-r--r--devel/gnome-vfs/Makefile3
-rw-r--r--devel/gnome-vfs/files/patch-libgnomevfs_gnome-vfs-mime.c57
2 files changed, 59 insertions, 1 deletions
diff --git a/devel/gnome-vfs/Makefile b/devel/gnome-vfs/Makefile
index 56132adc2..7507316e4 100644
--- a/devel/gnome-vfs/Makefile
+++ b/devel/gnome-vfs/Makefile
@@ -3,11 +3,12 @@
# Whom: Ade Lovett <ade@FreeBSD.org>
#
# $FreeBSD$
-# $MCom: ports/devel/gnomevfs2/Makefile,v 1.104 2005/08/24 13:03:58 kwm Exp $
+# $MCom: ports/devel/gnomevfs2/Makefile,v 1.105 2005/08/24 16:07:34 marcus Exp $
#
PORTNAME= gnomevfs2
PORTVERSION= 2.11.92
+PORTREVISION= 1
CATEGORIES= devel gnome
MASTER_SITES= ${MASTER_SITE_GNOME}
MASTER_SITE_SUBDIR= sources/gnome-vfs/2.11
diff --git a/devel/gnome-vfs/files/patch-libgnomevfs_gnome-vfs-mime.c b/devel/gnome-vfs/files/patch-libgnomevfs_gnome-vfs-mime.c
new file mode 100644
index 000000000..693ade8b7
--- /dev/null
+++ b/devel/gnome-vfs/files/patch-libgnomevfs_gnome-vfs-mime.c
@@ -0,0 +1,57 @@
+--- libgnomevfs/gnome-vfs-mime.c.orig Sun Aug 28 02:00:22 2005
++++ libgnomevfs/gnome-vfs-mime.c Sun Aug 28 02:07:11 2005
+@@ -211,7 +211,7 @@ _gnome_vfs_get_mime_type_internal (Gnome
+
+ if (buffer != NULL) {
+ result = _gnome_vfs_read_mime_from_buffer (buffer);
+-
++
+ if (result != NULL && result != XDG_MIME_TYPE_UNKNOWN) {
+
+ if ((strcmp (result, "application/x-ole-storage") == 0) ||
+@@ -229,9 +229,13 @@ _gnome_vfs_get_mime_type_internal (Gnome
+ result = fn_result;
+ }
+
+- } else if (fn_result && fn_result != XDG_MIME_TYPE_UNKNOWN &&
++ } else {
++ G_LOCK (mime_mutex);
++ if (fn_result && fn_result != XDG_MIME_TYPE_UNKNOWN &&
+ xdg_mime_mime_type_subclass (fn_result, result)) {
+- result = fn_result;
++ result = fn_result;
++ }
++ G_UNLOCK (mime_mutex);
+ }
+
+ return result;
+@@ -243,18 +247,27 @@ _gnome_vfs_get_mime_type_internal (Gnome
+ * accurate source of type information BUT _only_ if
+ * the extension is a subtype of text/plain.
+ */
++ G_LOCK (mime_mutex);
+ if ((fn_result != NULL) && (fn_result != XDG_MIME_TYPE_UNKNOWN) &&
+ xdg_mime_mime_type_subclass (fn_result, "text/plain")) {
++ G_UNLOCK (mime_mutex);
+ return fn_result;
+ }
+
+ /* Didn't find an extension match, assume plain text. */
++ G_UNLOCK (mime_mutex);
+ return "text/plain";
+
+- } else if (_gnome_vfs_sniff_buffer_looks_like_mp3 (buffer)) {
+- return "audio/mpeg";
++ } else {
++ G_LOCK (mime_mutex);
++ if (_gnome_vfs_sniff_buffer_looks_like_mp3 (buffer)) {
++ G_UNLOCK (mime_mutex);
++ return "audio/mpeg";
++ }
++ G_UNLOCK (mime_mutex);
+ }
+ }
++
+ }
+
+ if (use_suffix &&