tech-userlevel archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: syslog message with wrong date, and patch for newsyslog
On Mon, 12 Jan 2015, David Holland wrote:
> > By the way, a couple days ago I updated my newsyslog with:
> >
> > Index: newsyslog.c
> > ===================================================================
> > RCS file: /cvsroot/src/usr.bin/newsyslog/newsyslog.c,v
> > retrieving revision 1.61
> > diff -u -r1.61 newsyslog.c
> > --- newsyslog.c 5 Sep 2013 11:34:40 -0000 1.61
> > +++ newsyslog.c 12 Jan 2015 15:12:25 -0000
> > @@ -623,7 +623,9 @@
> > sys_signame[log->signum], (u_long)pid));
> > if (!noaction)
> > if (kill(pid, log->signum))
> > - warn("kill");
> > + warn("kill -%s %lu",
> > + sys_signame[log->signum],
> > + (u_long)pid);
> > }
> > }
> >
> >
> > I now see my email has:
> >
> > From: root (Cron Daemon)
> > To: root
> > Subject: Cron <root@t1> /usr/bin/newsyslog
> >
> > newsyslog: kill -HUP 156: No such process
> >
> > Now I see that "156" is the same as logged above.
> >
> > Okay if I commit that minor change? Or will that break it for someone
> > relying on the terse "newsyslog: kill: No such process" output?
>
> Very unlikely. Please commit...
>
> (except, please use strsignal() rather than sys_signame[])
Okay, but I just reused same sys_signame[] idea in the same source file.
I will look at fixing other use of it too. Thanks for teaching me about
STRSIGNAL(3).
Home |
Main Index |
Thread Index |
Old Index