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

thunar 1.0.2 et wheezy



thunar ne fonctionne pas très bien sous wheezy avec XFCE (tour à tour corbeille
absente, ou bien mauvais montage des clefs USB, etc, même à partir d'une
installation «from scratch»). Bref, J'ai du fianelement prendre le bon vieux
thunar 1.0.2 de squeeze. Cependant celui ci pose un problème et donne l'erreur

Unexpected error from C library during 'pthread_cond_timedwait'

dès la création d'un document vide ou d'un répertoire.
Après m'être un chouia crispé en essayant plusieurs jeux de versions, j'ai
fini par utiliser le bon vieux gdb, les changelogs et les docs.
Il y a eu un changement important dans la glib où la fonction
pthread_cond_timedwait travaille avec une date butoir absolue et non un délai,
Les vieux programmes donnent donc systématiquement cette erreur. Les solutions
sont soit de surcharger la fonction pthread_cond_timedwait avec un LD-PRELOAD,
soit de patcher les prgrammes correspondants. Ainsi, ici

***********************************************
--- thunar-1.0.2.orig/thunar-vfs/thunar-vfs-monitor.c
+++ thunar-1.0.2/thunar-vfs/thunar-vfs-monitor.c
@@ -31,7 +31,7 @@
 #ifdef HAVE_STRING_H
 #include <string.h>
 #endif
-
+#include <sys/time.h>
 #include <thunar-vfs/thunar-vfs-monitor-private.h>
 #include <thunar-vfs/thunar-vfs-path-private.h>
 #include <thunar-vfs/thunar-vfs-private.h>
@@ -806,13 +806,22 @@
 void
 thunar_vfs_monitor_wait (ThunarVfsMonitor *monitor)
 {
-  static const GTimeVal tv = { 2, 0 };
-
+  /* Nouvelle fonction g_cond_timed_wait:
+     static const GTimeVal tv = { 2, 0 };
+  */
+  struct timespec tv;
+  struct timeval tvval;
   g_return_if_fail (THUNAR_VFS_IS_MONITOR (monitor));
 
   g_mutex_lock (monitor->lock);
+  gettimeofday(&tvval,NULL);
+  TIMEVAL_TO_TIMESPEC(&tvval, &tv);
+  /* on rajoute les 2s */
+  tv.tv_sec +=2; 
+  /* et voilà */
   while (g_atomic_int_get (&monitor->notifications_timer_id) != 0)
-    g_cond_timed_wait (monitor->cond, monitor->lock, (GTimeVal *) &tv);
+    /*    g_cond_timed_wait (monitor->cond, monitor->lock, (GTimeVal *) &tv); */
+    g_cond_timed_wait (monitor->cond, monitor->lock,&tv);
   g_mutex_unlock (monitor->lock);
 }
 
***************************************

permet de régler le problème. Les paquets thunar modifiés se trouvent sur

deb http://boisson.homeip.net/debian wheezy divers

François Boisson


Reply to: