Re: [PATCH 2/5] daemon: if one of the standard fds is missing open it to /dev/null
- From
Uwe Zeisberger <zeisberg@informatik.uni-freiburg.de>
- Date
- Jul 13, 2006, 14:36 UTC
- Message-ID
- <20060713143649.GA3395@informatik.uni-freiburg.de>
- In-Reply-To
- <E1G11nq-00076g-Aa@moooo.ath.cx>
Hello Matthias,
(Do you know you set the Mail-Followup-To Header? That is annoying.)
> devnull = open("/dev/null", O_RDWR, 0);
> while (devnull != -1 && devnull < 2)
> dup(devnull);You mean
devnull = dup(devnull);
, don't you?
> if (devnull == -1)
> die("..");
> close(devnull);Best regards Uwe
-- Uwe Zeisberger primes where sieve (p:xs) = [ x | x<-xs, x `rem` p /= 0 ]; \ primes = map head (iterate sieve [2..])