just curious about the difference between close({0,1,2}) and fclose({stdin,
stdout, stderr}).
i'm wondering how this helps:
my little test shows

close(0)                                = 0
close(1)                                = 0
close(2)                                = 0
close(0)                                = -1 EBADF (Bad file descriptor)
close(1)                                = -1 EBADF (Bad file descriptor)
close(2)                                = -1 EBADF (Bad file descriptor)

or

close(0)
= 0
close(1)
= 0
close(2)
= 0
fclose(0xb7f1b420)
= -1
fclose(0xb7f1b4c0)
= -1
fclose(0xb7f1b560)
= -1

isn't this what we want?

open("/dev/null", O_RDONLY);
open("/dev/null", O_WRONLY); /* or dup2(0,1) */
open("/dev/null", O_WRONLY); /* or dup2(0,2) */

On Thu, Nov 6, 2008 at 7:08 PM, Hugh Greenberg <[EMAIL PROTECTED]> wrote:

> This patch fixes a crash that occurs when the master has a debuglevel of
> 0 and a client has a debuglevel > 0.
>
> Thanks Ron for the fix.
>
> Signed-off-by: Hugh Greenberg <[EMAIL PROTECTED]>
>
>
> On Thu, 2008-11-06 at 12:22 -0800, ron minnich wrote:
> > if you ever do this:                 close(0);
> >                 close(1);
> >                 close(2);
> >
> > it's a good idea to do this:
> > fclose(stdin); fclose(stdout); fclose(stderr);
> >
> > ah well
> >
> > ron
>

Reply via email to