From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <846d1b2de75197606223b1bf147dc093.axp-list@archive.invalid> X-Archive-Original-Message-ID: <199704021103.GAA16921@avalon.harvard.edu> Date: Wed, 2 Apr 1997 12:26:12 +0100 (BST) From: Philip Blundell Subject: Re: Diald for Alpha In-Reply-To: <01BC3ECB.478AE760@orion> On Tue, 1 Apr 1997, Miguel A. Rivera wrote: > Has anyone ported the diald daemon to alpha? I was playing > around with the code in my UDB but after a really clean > compilation the code core dumps on me. > > I am running RedHat 4.1 using an UDB 166. The stock diald does fclose(NULL), which causes a core dump. Here are some patches I sent to Eric to improve the compatibility between diald 0.16 and glibc - see if they help. I haven't actually tested this on the Alpha, but it works on my PC with glibc. phil diff -u --recursive clean/diald-0.16/diald.c ./diald-0.16/diald.c --- clean/diald-0.16/diald.c Thu Dec 19 20:42:41 1996 +++ ./diald-0.16/diald.c Tue Mar 25 00:18:46 1997 @@ -164,7 +164,7 @@ { int pid; FILE *fp; - if (daemon) { + if (daemon_flag) { close(0); close(1); close(2); diff -u --recursive clean/diald-0.16/diald.h ./diald-0.16/diald.h --- clean/diald-0.16/diald.h Sun Dec 15 18:29:21 1996 +++ ./diald-0.16/diald.h Tue Mar 25 00:29:17 1997 @@ -36,17 +36,27 @@ */ #include /* #include */ -#include -#include -#include /* Shut up gcc about a redefinition that is harmless */ #undef LITTLE_ENDIAN +#ifndef __GLIBC__ #include #include +#include +#include +#include +#else +#include +#include +#include +#endif #include /* Hmm. Should there be a netinet pointer to these??? */ +#ifndef __GLIBC__ #include #include +#else +#include +#endif #include /* This only exists in kernels >= 1.3.75 */ @@ -224,7 +234,7 @@ int modem; int rotate_devices; int crtscts; -int daemon; +int daemon_flag; int dynamic_addrs; int dynamic_mode; int slip_encap; diff -u --recursive clean/diald-0.16/options.c ./diald-0.16/options.c --- clean/diald-0.16/options.c Sat Dec 21 07:17:21 1996 +++ ./diald-0.16/options.c Tue Mar 25 00:53:38 1997 @@ -53,7 +53,7 @@ int debug = 0; int modem = 0; int crtscts = 0; -int daemon = 1; +int daemon_flag = 1; int slip_encap = 0; int lock_dev = 0; int default_route = 0; @@ -103,7 +103,7 @@ {"mode","[ppp|slip|cslip|slip6|cslip6|aslip|dev]",1,0,set_mode}, /* Debugging options */ {"debug","",1,&debug,set_int}, - {"-daemon","",0,&daemon,clear_flag}, + {"-daemon","",0,&daemon_flag,clear_flag}, /* general options */ {"accounting-log","",1,&acctlog,set_str}, {"pidfile","",1,&pidlog,set_str}, @@ -219,7 +219,7 @@ debug = 0; modem = 0; crtscts = 0; - daemon = 1; + daemon_flag = 1; slip_encap = 0; lock_dev = 0; default_route = 0; @@ -560,7 +560,7 @@ if (acctlog && (acctfp = fopen(acctlog,"a")) == NULL) syslog(LOG_ERR,"Can't open accounting log file %s: %m",acctlog); else - fclose(acctfp); + if (acctfp) fclose(acctfp); if (flag) exit(1); } -- To unsubscribe: send e-mail to axp-list-request@redhat.com with 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com