Subject: FVWM: Re:FvwmCommandS doesn't work on the latest linux kernels!!!!!

From: [email-masked]
Date: Sat, 6 Feb 1999 13:21:22 -0700 (MST)

> The subject line says it all. linux kernel 2.1.125, 2.2.0pre4, and 2.2.0pre9
> (a.k.a 2.2.0-final) will not allow FvwmCommandS to load. It gives a
> "FvwmCommandS: dead pipe" error.
> 
> I posted this on linux-kernel but got no response. Has anyone gotten
> FvwmCommandS to work on the latest kernels, and if so, how?
> 
> Zack

Zack,

I tried with kernel 2.2.1 and fvwm 2.0.46, saw the problem. I don't
know why it causes a problem with 2.2.1 and not with 2.0.X, something
to do with malloc maybe. But I found a way.

It takes only one line change. It is easy enough to do with your
editor.

Find the line in FvwmCommandS.c
  SendText(Fd,"",0); /* tell fvwm that we are here */

Change it to the below by adding a space.
  SendText(Fd," ",0); /* tell fvwm that we are here */

That should do.

-- 
----------------------------------------------------------
Toshi Isogai    [email-masked]
磯貝利明
--
Visit the official FVWM web page at <URL: http://fvwm.math.uh.edu/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Adam L Rice <[email-masked]>
Date: Sun, 7 Feb 1999 16:50:24 +0000

>   SendText(Fd," ",0); /* tell fvwm that we are here */

Aaah yes, I see the problem, it's a bug in SendText which will (under some
circumstances) do a zero-byte system write. The behaviour of such a call is
undefined, and could cause the pipe to be closed.

The following (untested) patch, applied to libs/Module.c, should address the
problem, but it would be better if SendText used some sort of buffering, or
writev instead of write.

--- Module.c~	Fri Jan  8 21:23:16 1999
+++ Module.c	Sun Feb  7 16:45:13 1999
@@ -84,7 +84,8 @@
 
     w=strlen(message);
     write(fd[0],&w,sizeof(int));
-    write(fd[0],message,w);
+    if (w)
+       write(fd[0],message,w);
 
     /* keep going */
     w = 1;

-- 
Adam Rice -- [email-masked] -- Blackburn, Lancashire, England