Subject: Re: err(3) after daemon(3) in update(8)
To: VaX#n8 <vax@linkdead.paranoia.com>
From: Giles Lean <giles@nemeton.com.au>
List: netbsd-bugs
Date: 07/02/1999 00:22:50
On Thu, 01 Jul 1999 08:48:23 -0500  VaX#n8 wrote:

> /usr/src/usr.sbin/update/update.c
> 
>         daemon(0, 0);
> 
>         sa.sa_handler = mysync;
>         sigemptyset(&sa.sa_mask);
>         sa.sa_flags = 0;
>         if (sigaction(SIGALRM, &sa, (struct sigaction *)0) < 0)
>                 err(1, "sigaction");
> 
> These errors get written to /dev/null.

This code perhaps should call syslog() which has a chance of logging
an error, but in real life it is difficult to get sigaction() to fail
if you pass it correct arguments.

I admit in my own code I try to do something sensible if sigaction()
fails and I'm sure if you write a clean fix someone will commit
it, given the NetBSD project's liking for doing things The Right
Way. :-)

Regards,

Giles