minimodem: do not call setitimer(new_value=NULL)

Linux kernel warns:

    minimodem calls setitimer() with new_value NULL pointer. Misfeature support
    will be removed

Thanks Robert Hooker, for reporting.
This commit is contained in:
Kamal Mostafa 2013-01-25 15:03:54 -08:00
parent 1f74732147
commit 7ab18a268f
1 changed files with 7 additions and 2 deletions

View File

@ -98,6 +98,11 @@ static void fsk_transmit_stdin(
{0, 1000000/(float)(data_rate+data_rate*0.03) } // it_value
};
struct itimerval itv_zero = {
{0, 0}, // it_interval
{0, 0} // it_value
};
if ( tx_interactive )
signal(SIGALRM, tx_stop_transmit_sighandler);
@ -105,7 +110,7 @@ static void fsk_transmit_stdin(
while ( (c = getchar()) != EOF )
{
if ( tx_interactive )
setitimer(ITIMER_REAL, NULL, NULL);
setitimer(ITIMER_REAL, &itv_zero, NULL);
// fprintf(stderr, "<c=%d>", c);
unsigned int nwords;
@ -139,7 +144,7 @@ static void fsk_transmit_stdin(
setitimer(ITIMER_REAL, &itv, NULL);
}
if ( tx_interactive ) {
setitimer(ITIMER_REAL, NULL, NULL);
setitimer(ITIMER_REAL, &itv_zero, NULL);
signal(SIGALRM, SIG_DFL);
}
if ( !tx_transmitting )