From: chas w. <ch...@us...> - 2007-09-04 14:16:20
|
Update of /cvsroot/linux-atm/linux-atm/src/br2684 In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2156 Modified Files: Tag: V2_5_0 br2684ctl.c Log Message: The logging functions are currently being called most of the time with a newline character at the end. Unfortunately these characters are useless, and are transformed into underscores at the logs. So attached goes a patch that removes those newline characters from the syslog calls. From: "seventh guardian" <sev...@gm...> Index: br2684ctl.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/br2684/Attic/br2684ctl.c,v retrieving revision 1.1.2.10 retrieving revision 1.1.2.11 diff -C2 -d -r1.1.2.10 -r1.1.2.11 *** br2684ctl.c 4 Sep 2007 13:28:55 -0000 1.1.2.10 --- br2684ctl.c 4 Sep 2007 14:16:11 -0000 1.1.2.11 *************** *** 42,46 **** void exitFunc(void) { ! syslog (LOG_NOTICE,"Daemon terminated\n"); } --- 42,46 ---- void exitFunc(void) { ! syslog (LOG_NOTICE,"Daemon terminated"); } *************** *** 48,52 **** void int_signal(int dummy) { ! syslog (LOG_INFO,"Killed by a signal\n"); exit(0); } --- 48,52 ---- void int_signal(int dummy) { ! syslog (LOG_INFO,"Killed by a signal"); exit(0); } *************** *** 93,102 **** if (err == 0) ! syslog(LOG_NOTICE, "Interface \"%s\" created sucessfully\n",ni.ifname); else ! syslog(LOG_INFO, "Interface \"%s\" could not be created, reason: %s\n", ni.ifname, strerror(errno)); ! lastitf=num; /* even if we didn't create, because existed, assign_vcc wil want to know it! */ } else { syslog(LOG_ERR,"err: strange interface number %d", num ); --- 93,103 ---- if (err == 0) ! syslog(LOG_NOTICE, "Interface \"%s\" created sucessfully",ni.ifname); else ! syslog(LOG_INFO, "Interface \"%s\" could not be created, reason: %s", ni.ifname, strerror(errno)); ! lastitf=num; /* even if we didn't create, because existed, ! assign_vcc wil want to know it! */ } else { syslog(LOG_ERR,"err: strange interface number %d", num ); *************** *** 118,124 **** err=text2atm(astr,(struct sockaddr *)(&addr), sizeof(addr), T2A_PVC); if (err!=0) ! syslog(LOG_ERR,"Could not parse ATM parameters (error=%d)\n",err); ! syslog(LOG_NOTICE,"Communicating over ATM %d.%d.%d, encapsulation: %s\n", addr.sap_addr.itf, addr.sap_addr.vpi, addr.sap_addr.vci, --- 119,126 ---- err=text2atm(astr,(struct sockaddr *)(&addr), sizeof(addr), T2A_PVC); if (err!=0) ! syslog(LOG_ERR,"Could not parse ATM parameters (error=%d)",err); ! syslog(LOG_NOTICE,"Communicating over ATM %d.%d.%d, encapsulation: %s", ! addr.sap_addr.itf, addr.sap_addr.vpi, addr.sap_addr.vci, *************** *** 126,130 **** if ((fd = socket(PF_ATMPVC, SOCK_DGRAM, ATM_AAL5)) < 0) ! syslog(LOG_ERR,"failed to create socket %d, reason: %s", errno,strerror(errno)); if (qos.aal == 0) { --- 128,133 ---- if ((fd = socket(PF_ATMPVC, SOCK_DGRAM, ATM_AAL5)) < 0) ! syslog(LOG_ERR,"failed to create socket %d, reason: %s", ! errno,strerror(errno)); if (qos.aal == 0) { *************** *** 137,141 **** if ( (err=setsockopt(fd,SOL_SOCKET,SO_SNDBUF, &bufsize ,sizeof(bufsize))) ) ! syslog(LOG_ERR,"setsockopt SO_SNDBUF: (%d) %s\n",err, strerror(err)); if (setsockopt(fd, SOL_ATM, SO_ATMQOS, &qos, sizeof(qos)) < 0) --- 140,144 ---- if ( (err=setsockopt(fd,SOL_SOCKET,SO_SNDBUF, &bufsize ,sizeof(bufsize))) ) ! syslog(LOG_ERR,"setsockopt SO_SNDBUF: (%d) %s",err, strerror(err)); if (setsockopt(fd, SOL_ATM, SO_ATMQOS, &qos, sizeof(qos)) < 0) *************** *** 173,177 **** void usage(char *s) { ! printf("usage: %s [-b] [[-c number] [-e 0|1] [-s sndbuf] [-q qos] [-p 0|1] [-a [itf.]vpi.vci]*]*\n", s); printf(" encapsulations: 0=llc, 1=vcmux\n payloads: 0=routed, 1=bridged\n"); exit(1); --- 176,181 ---- void usage(char *s) { ! printf("usage: %s [-b] [[-c number] [-e 0|1] [-s sndbuf] [-q qos] [-p 0|1] " ! "[-a [itf.]vpi.vci]*]*\n", s); printf(" encapsulations: 0=llc, 1=vcmux\n payloads: 0=routed, 1=bridged\n"); exit(1); *************** *** 198,202 **** case 'q': printf ("optarg : %s",optarg); ! if (text2qos(optarg,&reqqos,0)) fprintf(stderr,"QOS parameter invalid\n"); break; case 'a': --- 202,207 ---- case 'q': printf ("optarg : %s",optarg); ! if (text2qos(optarg,&reqqos,0)) ! fprintf(stderr,"QOS parameter invalid"); break; case 'a': *************** *** 213,217 **** encap=(atoi(optarg)); if(encap<0){ ! syslog (LOG_ERR, "invalid encapsulation: %s:\n",optarg); encap=0; } --- 218,222 ---- encap=(atoi(optarg)); if(encap<0){ ! syslog (LOG_ERR, "invalid encapsulation: %s:",optarg); encap=0; } *************** *** 220,224 **** sndbuf=(atoi(optarg)); if(sndbuf<0){ ! syslog(LOG_ERR, "Invalid sndbuf: %s, using size of 8192 instead\n",optarg); sndbuf=8192; } --- 225,230 ---- sndbuf=(atoi(optarg)); if(sndbuf<0){ ! syslog(LOG_ERR, "Invalid sndbuf: %s, using size of 8192 instead", ! optarg); sndbuf=8192; } *************** *** 229,233 **** break; #else ! syslog(LOG_ERR, "payload option not supported.\n"); #endif case '?': --- 235,239 ---- break; #else ! syslog(LOG_ERR, "payload option not supported."); #endif case '?': *************** *** 282,286 **** signal(SIGTERM, int_signal); ! syslog (LOG_INFO, "RFC 1483/2684 bridge daemon started\n"); atexit (exitFunc); --- 288,292 ---- signal(SIGTERM, int_signal); ! syslog (LOG_INFO, "RFC 1483/2684 bridge daemon started"); atexit (exitFunc); |