Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Philip Blundell <pjb27@cam.ac.uk>
Subject: Re: Diald for Alpha
Date: Wed, 2 Apr 1997 12:26:12 +0100 (BST)	[thread overview]
Message-ID: <846d1b2de75197606223b1bf147dc093.axp-list@archive.invalid> (raw)
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 <netinet/in.h>
 /* #include <asm/byteorder.h> */
-#include <linux/tcp.h>
-#include <linux/udp.h>
-#include <linux/icmp.h>
 /* Shut up gcc about a redefinition that is harmless */
 #undef LITTLE_ENDIAN
+#ifndef __GLIBC__
 #include <linux/ip.h>
 #include <linux/in.h>
+#include <linux/udp.h>
+#include <linux/tcp.h>
+#include <linux/icmp.h>
+#else
+#include <netinet/ip.h>
+#include <netinet/udp.h>
+#include <netinet/tcp.h>
+#endif
 #include <arpa/inet.h>
 /* Hmm. Should there be a netinet pointer to these??? */
+#ifndef __GLIBC__ 
 #include <linux/if_ether.h>
 #include <linux/if_slip.h>
+#else
+#include <net/ethernet.h>
+#endif
 
 #include <linux/version.h>
 /* 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","<debugmask>",1,&debug,set_int},
-    {"-daemon","",0,&daemon,clear_flag},
+    {"-daemon","",0,&daemon_flag,clear_flag},
 /* general options */
     {"accounting-log","<f>",1,&acctlog,set_str},
     {"pidfile","<f>",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

       reply	other threads:[~1997-04-02 11:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <01BC3ECB.478AE760@orion>
1997-04-02 11:26 ` Philip Blundell [this message]
1997-04-02  0:33 Diald for Alpha Miguel A. Rivera
  -- strict thread matches above, loose matches on Subject: below --
1997-03-14 20:20 diald " Miguel Rivera
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox