summaryrefslogtreecommitdiff
path: root/comms/ifcico-cm/patches/patch-ap
blob: ad691a2ba28c2787fff63995816c13cb034bf136 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
$NetBSD: patch-ap,v 1.2 2001/02/21 18:50:37 tv Exp $

--- ifcico/hydra.c.orig	Sun Nov 15 15:13:14 1998
+++ ifcico/hydra.c	Wed Feb 21 10:51:23 2001
@@ -89,7 +89,7 @@
 
 static char *put_long(char *buffer, long val)
 {
-#if defined(__i386__)
+#if defined(__i386__) || (defined(__NetBSD__) && (BYTE_ORDER == LITTLE_ENDIAN))
   *(unsigned long *) buffer = (unsigned long) val;
 #else
   buffer[0] = (unsigned long) val & 0xff;
@@ -104,7 +104,7 @@
 
 static long get_long(char *buffer)
 {
-#if defined(__i386__)
+#if defined(__i386__) || (defined(__NetBSD__) && (BYTE_ORDER == LITTLE_ENDIAN))
   return *(long *) buffer;
 #else
   return ((unsigned long) ((unsigned char) buffer[0])) |
@@ -530,8 +530,8 @@
   char *inbuf, *outbuf;
   int rxlen, txlen;		/* length of receive/transmit buffer */
   long txwindow, rxwindow;	/* window sizes */
-  long txpos, rxpos;		/* file positions */
-  long stxpos, srxpos;
+  off_t txpos, rxpos;		/* file positions */
+  off_t stxpos, srxpos;
   long longnum;
   int hdxlink = 0;
   int txretries, rxretries;
@@ -894,8 +894,8 @@
 	if (to_send)
 	{
 	  txlen = sprintf(txbuf, "%08lx%08lx%08lx%08lx%08lx",
-			  mtime2sl(txstat.st_mtime),
-			  txstat.st_size,
+			  (unsigned long)mtime2sl(txstat.st_mtime),
+			  (unsigned long)txstat.st_size,
 			  0UL,
 			  0UL,
 			  0UL);
@@ -1353,7 +1353,7 @@
 	 */
 	else if ((rxlen > 41) && (rxbuf[rxlen - 1] == 0))
 	{
-	  time_t timestamp;
+	  long timestamp;
 	  long filesize;
 	  char dosname[8 + 1 + 3 + 1], *name;