Xref: utzoo comp.unix.wizards:22362 comp.bugs.4bsd:1564 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!snorkelwacker!bloom-beacon!athena.mit.edu!jik From: jik@athena.mit.edu (Jonathan I. Kamens) Newsgroups: comp.unix.wizards,comp.bugs.4bsd Subject: more BSD strangeness -- syslogd.c Message-ID: <1990Jun8.070904.7466@athena.mit.edu> Date: 8 Jun 90 07:09:04 GMT Sender: news@athena.mit.edu (News system) Reply-To: jik@athena.mit.edu (Jonathan I. Kamens) Organization: Massachusetts Institute of Technology Lines: 22 Here's another little gem of code from BSD4.3 that I don't quite understand. Pulled from etc/syslogd.c: if (!Debug) { if (fork()) exit(0); for (i = 0; i < 10; i++) (void) close(i); (void) open("/", 0); (void) dup2(0, 1); (void) dup2(0, 2); untty(); } OK, so why is it opening "/"? Is this a poor man's equivalent to /dev/null, and if so, why doesn't it just open /dev/null? Jonathan Kamens USnail: MIT Project Athena 11 Ashford Terrace jik@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8495 Home: 617-782-0710