[Top][All Lists]

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

[Nano-devel] Re: Speller file descriptor leaks.

From: Chris Allegretta
Subject: [Nano-devel] Re: Speller file descriptor leaks.
Date: Mon, 16 Dec 2002 17:40:50 -0800
User-agent: Mutt/

On Mon, Dec 16, 2002 at 04:15:57PM -0500, David Benbennick wrote:
> It seems to me that making this code watertight would be complicated.  I
> think a better solution is to call
> system("exec spell < \"[tempfile_name]\" | sort -f | uniq");
> This way we pass error checking responsibility to the shell.  Also, we
> need only one fork() and one pipe() (to read the shell's reply).
> This idea has been implemented in the newly updated patch
>  (Find the relevant 
> bit by searching for "system(cmd)"

It's hard to argue with code that much smaller :-)   That's how I wanted to 
do it originally but I was worried about 

- systems who are not using /bin/sh (cygwin stand-alone systems?)
- PATH security

But I guess we have the second issue either way.  The first I'm not 
sure.  Feedback?

(I busted my ass on that code this weekend too, oh well ;-)

Chris A
Chris Allegretta

"Share and Enjoy" - Douglas Adams, 1952 - 2001

reply via email to

[Prev in Thread] Current Thread [Next in Thread]