more BSD strangeness -- syslogd.c

Steven Bellovin smb at ulysses.att.com
Tue Jun 12 01:10:40 AEST 1990


In article <3446 at auspex.auspex.com>, hitz at auspex.auspex.com (Dave Hitz) writes:
} This answers the question "why close all open files", but it doesn't
} answer the question, "why open anything at all for descriptors 0, 1 and
} 2."  If it makes no reference to stdin, stdout, stderr, why must there
} be something open for them?
} 
} I can (and have) made up several answers for this.  Anyone know the real
} one?  What happens if you just leave the descriptors closed?

It probably doesn't apply to syslogd, but in general if 0,1,2 are
closed you confuse a lot of programs that you fork/open/dup/exec to.

Yes, I've seen it happen.  Many times.



More information about the Comp.unix.wizards mailing list