Subject: Re: FvwmCommandS dumps core -- problem solved

From: Dominik Vogt <[email-masked]>
Date: Wed, 1 Dec 1999 10:02:03 +0100

The close_fifos() function was indeed called twice, I guess once
when fvwm signaled shutdown to the modules and once when
FvwmCommandS got the dead pipe signal.  I wonder if any other
modules might have the same bug.

I'va attached a patch.  Could someone please apply it?

ChangeLog:

1999-12-01  Dominik Vogt  <[email-masked]>

* FvwmCommand/FvwmCommandS.c (close_pipes):
prevent multiple call of this function to prevent core dump

Bye

Dominik ^_^

-- 
Dominik Vogt, Agilent Technologies, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/464-4596, fax: 07031/464-3883, [email-masked]
--- FvwmCommandS.c.orig	Wed Dec  1 09:54:48 1999
+++ FvwmCommandS.c	Wed Dec  1 09:56:58 1999
@@ -259,10 +259,18 @@
 /*
  * close  fifos and pipes
  */
-void close_pipes(void) {
-  close (Fd[0]);
-  close (Fd[1]);
-  close_fifos();
+void close_pipes(void)
+{
+  static char is_closed = 0;
+
+  /* prevent that this is executed twice */
+  if (!is_closed)
+  {
+    close (Fd[0]);
+    close (Fd[1]);
+    close_fifos();
+    is_closed = 1;
+  }
 }
 
 void close_fifos(void) {