From: chas w. <ch...@us...> - 2008-01-01 00:14:55
|
Update of /cvsroot/linux-atm/linux-atm/src/lib In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv24942/src/lib Modified Files: Makefile.am diag.c sap2text.c sapequal.c Added Files: .cvsignore Log Message: merge 2.5.0 branch into the head Index: Makefile.am =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/lib/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile.am 9 Oct 2001 22:33:07 -0000 1.2 --- Makefile.am 1 Jan 2008 00:14:51 -0000 1.3 *************** *** 3,7 **** # ATMLIBS_VERSION comes from configure.in in the toplevel directory ! LDFLAGS = -version-info @LIBVER_CURRENT@:@LIBVER_REVISION@:@LIBVER_AGE@ --- 3,7 ---- # ATMLIBS_VERSION comes from configure.in in the toplevel directory ! AM_LDFLAGS = -version-info @LIBVER_CURRENT@:@LIBVER_REVISION@:@LIBVER_AGE@ *************** *** 14,32 **** libatm_la_DEPENDENCIES = $(top_builddir)/src/include/atm.h \ $(top_builddir)/src/include/atmsap.h \ - $(top_builddir)/src/include/stdint.h \ $(top_builddir)/src/include/atmd.h - - - #libatm_la_SOURCES = text2atm.c atm2text.c atmequal.c sdu2cell.c text2qos.c \ - # qos2text.c qosequal.c sap2text.c text2sap.c sapequal.c \ - # misc.c atmres.h ans.c - #libatm_la_LIBADD = -lresolv - #libatm_la_DEPENDENCIES = $(top_builddir)/src/include/atm.h \ - # $(top_builddir)/src/include/atmsap.h \ - # $(top_builddir)/src/include/stdint.h - # - #libatmd_la_SOURCES = common.c diag.c kptr.c text2ip.c timer.c unix.c - #libatmd_la_DEPENDENCIES = $(top_builddir)/src/include/atm.h \ - # $(top_builddir)/src/include/atmd.h \ - # $(top_builddir)/src/include/stdint.h - --- 14,16 ---- Index: diag.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/lib/diag.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** diag.c 9 Oct 2001 22:33:07 -0000 1.2 --- diag.c 1 Jan 2008 00:14:51 -0000 1.3 *************** *** 12,15 **** --- 12,17 ---- #include <string.h> #include <syslog.h> + #include <signal.h> + #include <time.h> #include "atmd.h" *************** *** 127,131 **** --- 129,137 ---- FILE *to; char buffer[MAX_DIAG_MSG+1]; + struct timeval tv; int i; + #define DATESTR_LEN 32 + char datestr[DATESTR_LEN]; + struct tm tm; for (walk = components; walk; walk = walk->next) *************** *** 136,145 **** if (!to) { for (i = 0; sev2prio[i] == severity || sev2prio[i] == -1; i += 2); ! vsprintf(buffer,fmt,ap); syslog(sev2prio[i+1],"%s: %s",component,buffer); } else { ! if (app_name) fprintf(to,"%s:%s: ",app_name,component); ! else fprintf(to,"%s: ",component); vfprintf(to,fmt,ap); fputc('\n',to); --- 142,157 ---- if (!to) { for (i = 0; sev2prio[i] == severity || sev2prio[i] == -1; i += 2); ! vsnprintf(buffer,MAX_DIAG_MSG+1,fmt,ap); syslog(sev2prio[i+1],"%s: %s",component,buffer); } else { ! gettimeofday(&tv,NULL); ! localtime_r((time_t *) &tv.tv_sec, &tm); ! strftime(datestr, DATESTR_LEN, "%b %d %T", &tm); ! if (app_name) ! fprintf(to, "%s.%06lu %s:%s: ", ! datestr, (unsigned long) tv.tv_usec, app_name, component); ! else ! fprintf(to,"%s.%06lu %s: ", datestr, (unsigned long) tv.tv_usec, component); vfprintf(to,fmt,ap); fputc('\n',to); Index: sap2text.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/lib/sap2text.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sap2text.c 9 Oct 2001 22:33:07 -0000 1.2 --- sap2text.c 1 Jan 2008 00:14:51 -0000 1.3 *************** *** 42,46 **** va_start(ap,fmt); ! len = vsprintf(scratch,fmt,ap); va_end(ap); if (!len) return 0; --- 42,46 ---- va_start(ap,fmt); ! len = vsnprintf(scratch,40,fmt,ap); va_end(ap); if (!len) return 0; Index: sapequal.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/lib/sapequal.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sapequal.c 9 Oct 2001 22:33:07 -0000 1.2 --- sapequal.c 1 Jan 2008 00:14:51 -0000 1.3 *************** *** 65,69 **** CHECK(l2.itu.window,a.l2.itu.window > b.l2.itu.window); break; - default: } switch (a.l3_proto) { --- 65,68 ---- *************** *** 83,87 **** if (a.l3.user != b.l3.user) return 0; break; - default: } return 1; --- 82,85 ---- |