From: chas w. <ch...@us...> - 2004-02-26 01:14:28
|
Update of /cvsroot/linux-atm/linux-atm/src/br2684 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20929/br2684 Modified Files: Tag: V2_5_0 br2684ctl.c Log Message: create pid file /var/run/nas%d when started Index: br2684ctl.c =================================================================== RCS file: /cvsroot/linux-atm/linux-atm/src/br2684/Attic/br2684ctl.c,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** br2684ctl.c 19 Jul 2003 22:24:51 -0000 1.1.2.2 --- br2684ctl.c 26 Feb 2004 00:59:04 -0000 1.1.2.3 *************** *** 44,47 **** --- 44,63 ---- + int create_pidfile(int num) + { + FILE *pidfile = NULL; + char name[32]; + + if (num < 0) return -1; + + snprintf(name, 20, "/var/run/nas%d.pid", num); + pidfile = fopen(name, "w"); + if (pidfile == NULL) return -1; + fprintf(pidfile, "%d", getpid()); + fclose(pidfile); + + return 0; + } + int create_br(char *nstr) { *************** *** 159,162 **** --- 175,179 ---- int c, background=0, encap=0, sndbuf=8192; struct atm_qos reqqos; + int itfnum; lastsock=-1; lastitf=0; *************** *** 181,184 **** --- 198,202 ---- case 'c': create_br(optarg); + itfnum = atoi(optarg); break; case 'e': *************** *** 243,246 **** --- 261,266 ---- } + create_pidfile(itfnum); + syslog (LOG_INFO, "RFC 1483/2684 bridge daemon started\n"); atexit (exitFunc); |