>>>>> "Rich" == Rich Felker <[email protected]> writes:
Rich> On Mon, Jan 24, 2011 at 09:03:45AM +0100, Peter Korsgaard wrote: >> Ok, what about: >> >> + /* Wait up to 5 seconds for the output buffer to drain */ >> + signal(SIGALRM, record_signo); >> + alarm(5); >> + tcdrain(STDIN_FILENO); >> + alarm(0); >> + signal(SIGALRM, SIG_DFL); >> tcflush(STDIN_FILENO, TCIOFLUSH); Rich> How does this work? Normally plain signal sets SA_RESTART and won't be Rich> interrupting. You need sigaction without SA_RESTART, or the BB Rich> wrapper, to get the interrupting behavior that's desired. Was this Rich> code tested? No, like I said: > Why not use the alarm() approach like suggested? E.G. something like > (untested): I'll respin with signal_no_SA_RESTART_empty_mask(). -- Bye, Peter Korsgaard _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
