"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/signals.c" between
rlwrap-0.45.tar.gz and rlwrap-0.45.1.tar.gz

About: rlwrap is a "readline wrapper" allowing the editing of keyboard input for any command.

signals.c  (rlwrap-0.45):signals.c  (rlwrap-0.45.1)
skipping to change at line 438 skipping to change at line 438
exit(0); exit(0);
} }
static int myalarm_was_set = FALSE; static int myalarm_was_set = FALSE;
/* drop-in replacement for alarm (*but* with arg in msecs, not secs). Also sets global flag /* drop-in replacement for alarm (*but* with arg in msecs, not secs). Also sets global flag
myalarm_was_set */ myalarm_was_set */
void myalarm(int msecs) { void myalarm(int msecs) {
#ifdef HAVE_SETITIMER #ifdef HAVE_SETITIMER
int retval;
struct itimerval awhile = {{0,0},{0,0}}; struct itimerval awhile = {{0,0},{0,0}};
awhile.it_value.tv_usec = msecs * 1000; int secs = msecs/1000;
awhile.it_value.tv_sec = secs;
awhile.it_value.tv_usec = (msecs - secs * 1000) * 1000;
received_sigALRM = FALSE; received_sigALRM = FALSE;
setitimer(ITIMER_REAL, &awhile, NULL); retval = setitimer(ITIMER_REAL, &awhile, NULL);
DPRINTF3(DEBUG_AD_HOC, "setitimer() = %d (tv_sec = %d, tv_usec=%ld)", retval,
secs, awhile.it_value.tv_usec);
#else #else
received_sigALRM = FALSE; received_sigALRM = FALSE;
alarm(msecs == 0 ? 0 : 1 + msecs/1000)); alarm(msecs == 0 ? 0 : 1 + msecs/1000));
#endif #endif
DPRINTF1(DEBUG_AD_HOC, "set alarm (%d msecs)", msecs); DPRINTF1(DEBUG_AD_HOC, "set alarm (%d msecs)", msecs);
if (msecs == 0) if (msecs == 0)
return; return;
myalarm_was_set = TRUE; myalarm_was_set = TRUE;
} }
 End of changes. 3 change blocks. 
2 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)