On Tuesday 11 November 2008 07:04, Vladimir Dronnikov wrote:
> >
> > "break" breaks from switch(), not from for().
> 
> 
> Right. I just rarely saw break in switch default branch. If we'd revert the
> condition...

Is it better this way?

                if (bb_got_signal == SIGHUP) {
                        for (i = 0; i < svnum; i++)
                                if (sv[i].pid)
                                        kill(sv[i].pid, SIGTERM);
                }
                /* SIGHUP or SIGTERM (or SIGUSRn if we are init) */
                /* Exit unless we are init */
                if (getpid() != 1)
                        return (SIGHUP == bb_got_signal) ? 111 : EXIT_SUCCESS;

                /* init continues to monitor services forever */
                bb_got_signal = 0;
        } /* for (;;) */
}

--
vda
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to