Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > 47d290cd3b54c3ab8b3c44b18e80663c > files > 1

thunar-0.8.0-8mdv2008.0.src.rpm

diff -Naur Thunar-0.8.0/thunar-vfs/thunar-vfs-exec.c Thunar-0.8.0.tpg/thunar-vfs/thunar-vfs-exec.c
--- Thunar-0.8.0/thunar-vfs/thunar-vfs-exec.c	2007-01-20 20:39:09.000000000 +0000
+++ Thunar-0.8.0.tpg/thunar-vfs/thunar-vfs-exec.c	2007-09-04 17:20:58.000000000 +0000
@@ -25,6 +25,9 @@
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
+#ifdef HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
 
 #ifdef HAVE_ERRNO_H
 #include <errno.h>
@@ -337,6 +340,7 @@
                     gpointer data)
 {
   TvsnStartupData *startup_data = data;
+  gint             ret, serrno;
 
   _thunar_vfs_return_if_fail (startup_data->sn_launcher != NULL);
   _thunar_vfs_return_if_fail (startup_data->watch_id != 0);
@@ -346,6 +350,19 @@
   sn_launcher_context_complete (startup_data->sn_launcher);
   sn_launcher_context_unref (startup_data->sn_launcher);
   startup_data->sn_launcher = NULL;
+  
+  /* check for zombie processes owned by thunar */
+  serrno = errno;
+  while (1)
+    {
+      /* get the child process state without locking */
+      ret = waitpid (WAIT_ANY, NULL, WNOHANG);
+        
+      /* exit if there is nothing to wait for */
+      if (ret == 0 || ret < 0)
+        break;
+    }
+  errno = serrno;
 
   /* cancel the startup notification timeout */
   g_source_remove (startup_data->timeout_id);