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);
How does this work? Normally plain signal sets SA_RESTART and won't be interrupting. You need sigaction without SA_RESTART, or the BB wrapper, to get the interrupting behavior that's desired. Was this code tested? Rich _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
