patch to make script(1) exit cleanly on reciept of signal

Chris Pressey cpressey at catseye.mine.nu
Wed Mar 31 20:21:47 PST 2004


On Wed, 31 Mar 2004 19:47:56 -0800 (PST)
Matthew Dillon <dillon at xxxxxxxxxxxxxxxxxxxx> wrote:

> :Chris Pressey <cpressey at xxxxxxxxxxxxxxx> wrote:
> :> http://catseye.webhop.net/DragonFlyBSD/patch/script.diff
>
>     Looks good.  One change and you are done... a flushtime of 0 is 
>     now illegal (because that will cause the select() to poll and
>     script to go into a cpu-bound loop), so change the flushtime < 0
>     test to flushtime <= 0.

Er - I just realized - I think it's even worse than that.  If the user
specifies a flushtime of 0 (which is perfectly legal according to the
man page, and I don't think we want to change that,) tvp is a NULL
pointer rather than a pointer to our timeout.  Which means our signal
handler doesn't have any effect at all on select(), because it's
changing a timeout that isn't used :)

Thanks for making me think about it - I'll rewrite it, probably using
your suggestion #1 instead.

-Chris





More information about the Submit mailing list