Re: FVWM: CMD_Exec() leaks an extra file descriptor to children

2010-07-28 Thread Thomas Adam
On Tue, Jul 27, 2010 at 10:49:10PM +0100, Thomas Adam wrote: On Tue, Jul 27, 2010 at 12:21:17PM -0400, Chris Siebenmann wrote: There's a small file descriptor leak in CMD_Exec() in fvwm/builtins.c; it opens /dev/null, dup2()s it to standard input, and then never closes the original file

FVWM: CMD_Exec() leaks an extra file descriptor to children

2010-07-27 Thread Chris Siebenmann
There's a small file descriptor leak in CMD_Exec() in fvwm/builtins.c; it opens /dev/null, dup2()s it to standard input, and then never closes the original file descriptor before exec'ing the command. The neurotically correct fix for this (in what I think is the right fvwm coding style) is: