commit:     8c778578a4f5e73a7edff20e09d35afbac7a8c06
Author:     Bernard Cafarelli <voyageur <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 30 22:20:05 2021 +0000
Commit:     Bernard Cafarelli <voyageur <AT> gentoo <DOT> org>
CommitDate: Thu Sep 30 22:20:33 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8c778578

sys-fs/mtpfs: fix deprecated init of lock

This became an error with glib 2.70

Closes: https://bugs.gentoo.org/814965
Package-Manager: Portage-3.0.26, Repoman-3.0.3
Signed-off-by: Bernard Cafarelli <voyageur <AT> gentoo.org>

 .../files/mtpfs-1.1-deprecated_lock_init.patch     | 24 ++++++++++++++++++++++
 sys-fs/mtpfs/mtpfs-1.1-r6.ebuild                   |  3 ++-
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/sys-fs/mtpfs/files/mtpfs-1.1-deprecated_lock_init.patch 
b/sys-fs/mtpfs/files/mtpfs-1.1-deprecated_lock_init.patch
new file mode 100644
index 00000000000..d369ebfe1f2
--- /dev/null
+++ b/sys-fs/mtpfs/files/mtpfs-1.1-deprecated_lock_init.patch
@@ -0,0 +1,24 @@
+diff -Naur mtpfs-1.1.orig/mtpfs.c mtpfs-1.1/mtpfs.c
+--- mtpfs-1.1.orig/mtpfs.c     2021-10-01 00:15:15.763423589 +0200
++++ mtpfs-1.1/mtpfs.c  2021-10-01 00:16:07.626486888 +0200
+@@ -1371,6 +1371,8 @@
+     extern int optind;
+     extern char *optarg;
+ 
++    g_mutex_init(&device_lock);
++
+     //while ((opt = getopt(argc, argv, "d")) != -1 ) {
+         //switch (opt) {
+         //case 'd':
+diff -Naur mtpfs-1.1.orig/mtpfs.h mtpfs-1.1/mtpfs.h
+--- mtpfs-1.1.orig/mtpfs.h     2021-10-01 00:15:15.779423609 +0200
++++ mtpfs-1.1/mtpfs.h  2021-10-01 00:16:20.322502337 +0200
+@@ -77,7 +77,7 @@
+ static GSList *myfiles = NULL;
+ static LIBMTP_playlist_t *playlists = NULL;
+ static gboolean playlists_changed = FALSE;
+-static GMutex device_lock = G_STATIC_MUTEX_INIT;
++static GMutex device_lock;
+ 
+ 
+ #endif /* _MTPFS_H_ */

diff --git a/sys-fs/mtpfs/mtpfs-1.1-r6.ebuild b/sys-fs/mtpfs/mtpfs-1.1-r6.ebuild
index 3bc2351e26c..04dd5b86b90 100644
--- a/sys-fs/mtpfs/mtpfs-1.1-r6.ebuild
+++ b/sys-fs/mtpfs/mtpfs-1.1-r6.ebuild
@@ -27,7 +27,8 @@ DOCS=(AUTHORS NEWS README)
 PATCHES=( "${FILESDIR}"/${P}-fix-mutex-crash.patch
        "${FILESDIR}"/${P}-unitialized-variable.patch
        "${FILESDIR}"/${P}-wking-patches/
-       "${FILESDIR}"/${P}-g_printf.patch )
+       "${FILESDIR}"/${P}-g_printf.patch
+       "${FILESDIR}"/${P}-deprecated_lock_init.patch )
 
 src_prepare() {
        default

Reply via email to