Index: ossp-pkg/l2/configure.ac RCS File: /v/ossp/cvs/ossp-pkg/l2/configure.ac,v rcsdiff -q -kk '-r1.12' '-r1.13' -u '/v/ossp/cvs/ossp-pkg/l2/configure.ac,v' 2>/dev/null --- configure.ac 2001/10/12 14:46:16 1.12 +++ configure.ac 2001/10/31 16:47:05 1.13 @@ -81,6 +81,8 @@ fi AC_CHECK_LIB(socket, accept) +AC_CHECK_HEADERS(sys/time.h) + AC_CHECK_FUNCS(inet_aton inet_pton inet_ntoa inet_ntop snprintf vsnprintf setitimer) sinclude(l2_ut_sa.ac) Index: ossp-pkg/l2/l2_ch_buffer.c RCS File: /v/ossp/cvs/ossp-pkg/l2/l2_ch_buffer.c,v rcsdiff -q -kk '-r1.29' '-r1.30' -u '/v/ossp/cvs/ossp-pkg/l2/l2_ch_buffer.c,v' 2>/dev/null --- l2_ch_buffer.c 2001/10/30 18:55:27 1.29 +++ l2_ch_buffer.c 2001/10/31 16:47:05 1.30 @@ -34,7 +34,7 @@ #include /* for alarm(3) */ #include /* for sigaction(2) and SIGALRM */ -#ifdef HAVE_SETITIMER +#ifdef HAVE_SYS_TIME_H #include /* for setitimer(2) */ #endif @@ -47,7 +47,7 @@ int bufsize; long bufinterval; struct sigaction sigalrm; -#ifdef HAVE_SETITIMER +#if defined HAVE_SETITIMER && defined HAVE_SYS_TIME_H struct itimerval valprev; #endif int levelflush; @@ -57,7 +57,7 @@ /* Sets the VIRTUAL timer to preconfigured value in cfg */ static int set_alarm(l2_ch_buffer_t *cfg) { -#ifdef HAVE_INET_SETITIMER +#if defined HAVE_SETITIMER && defined HAVE_SYS_TIME_H struct itimerval valtest, valnew; /* initialize auto vars before using them */ @@ -67,22 +67,22 @@ valnew.it_interval.tv_usec = 0; valnew.it_value.tv_sec = cfg->bufinterval; valnew.it_value.tv_usec = 0; - if ((getitimer(L2_BUFFER_TIMER, &testval) == 0) && - ((testval.it_value.tv_sec | testval.it_value.tv_usec | - testval.it_interval.tv_sec | testval.it_interval.tv_usec) == 0)) + if ((getitimer(L2_BUFFER_TIMER, &valtest) == 0) && + ((valtest.it_value.tv_sec | valtest.it_value.tv_usec | + valtest.it_interval.tv_sec | valtest.it_interval.tv_usec) == 0)) return setitimer(L2_BUFFER_TIMER, &valnew, &cfg->valprev); else { cfg->bufinterval = -1L; /* mark this timer as broken */ assert(FALSE); + return 1; /* to make the compiler happy */ } #else unsigned int uiAlarmed = 0; - uiAlarmed = alarm(cfg->bufinterval); + assert(uiAlarmed = alarm(cfg->bufinterval)); if (uiAlarmed) { /* check if SIGALRM is occupied */ alarm(uiAlarmed); /* ...if so, then hack in the old value */ cfg->bufinterval = -1L; /* ...mark this timer as broken */ - assert(FALSE); /* ...and warn the user about problems */ } return 0; #endif @@ -91,7 +91,7 @@ /* Resets the VIRTUAL timer to preconfigured value in cfg */ static int reset_alarm(l2_ch_buffer_t *cfg) { -#ifdef HAVE_INET_SETITIMER +#if defined HAVE_SETITIMER && defined HAVE_SYS_TIME_H struct itimerval valnew; /* initialize auto vars before using them */ @@ -123,9 +123,7 @@ else if (sig == SIGALRM) { TRACE("SIGALRM caught"); l2_channel_flush(ch); -#ifndef HAVE_SETITIMER reset_alarm(cfg); /* alarm(3) doesn't auto-reset like setitime(2) */ -#endif } } @@ -146,7 +144,7 @@ cfg->levelflush = 0; cfg->level = L2_LEVEL_NONE; memset(&cfg->sigalrm, 0, sizeof(cfg->sigalrm)); -#ifdef HAVE_SETITIMER +#if defined HAVE_SETITIMER && defined HAVE_SYS_TIME_H memset(&cfg->valprev, 0, sizeof(cfg->valprev)); #endif @@ -293,7 +291,7 @@ l2_result_t rv; if ((cfg->bufinterval != 0) && (cfg->bufinterval != -1L)) { -#ifdef HAVE_INET_SETITIMER +#if defined HAVE_SETITIMER && defined HAVE_SYS_TIME_H if (setitimer(L2_BUFFER_TIMER, &cfg->valprev, 0)) /* restore timer */ return L2_ERR_SYS; #else Index: ossp-pkg/l2/l2_ut_level.c RCS File: /v/ossp/cvs/ossp-pkg/l2/l2_ut_level.c,v rcsdiff -q -kk '-r1.5' '-r1.6' -u '/v/ossp/cvs/ossp-pkg/l2/l2_ut_level.c,v' 2>/dev/null --- l2_ut_level.c 2001/10/09 15:34:55 1.5 +++ l2_ut_level.c 2001/10/31 16:47:05 1.6 @@ -57,7 +57,7 @@ len = maxlen; string[0] = '\0'; - for (i = 0; l2s_table[i].level != NULL; i++) { + for (i = 0; l2s_table[i].level != 0; i++) { if (levelmask & l2s_table[i].level) { levelmask &= ~(l2s_table[i].level); l = strlen(l2s_table[i].string) + 1; @@ -126,7 +126,7 @@ if (cpE > (string+maxlen)) break; bFound = 0; - for (i = 0; l2s_table[i].level != NULL; i++) { + for (i = 0; l2s_table[i].level != 0; i++) { if (strncasecmp(cpB, l2s_table[i].string, cpE-cpB) == 0) { *levelmask |= l2s_table[i].level; bFound = 1;