diff options
author | steve <steve@FreeBSD.org> | 1999-08-29 23:16:42 +0800 |
---|---|---|
committer | steve <steve@FreeBSD.org> | 1999-08-29 23:16:42 +0800 |
commit | 3e55b0a8fe7020cf84ed804f73d65e8793cd95b7 (patch) | |
tree | e86dc2b8ce4775c8f8db5b04032b52d4ef2d3bd7 /net | |
parent | d10a1b7230b629b8c06e2b0ec24a7376ba0b02ed (diff) | |
download | freebsd-ports-gnome-3e55b0a8fe7020cf84ed804f73d65e8793cd95b7.tar.gz freebsd-ports-gnome-3e55b0a8fe7020cf84ed804f73d65e8793cd95b7.tar.zst freebsd-ports-gnome-3e55b0a8fe7020cf84ed804f73d65e8793cd95b7.zip |
Make this port interoperable on the FreeBSD/Alpha. From Andrew Gallatin:
Due to the size difference between a struct timeval on FreeBSD/Alpha
(2 longs for a total of 128 bits) and a struct timeval nearly
everywhere else in the known universe (2 ints, for a total of 64-bits,
even on DEC OSF/1), and the way zephyr uses timevals, it needs a bit
of help.
Submitted by: Adrew Gallatin <gallatin@cs.duke.edu>
Obtained from: NetBSD
Diffstat (limited to 'net')
-rw-r--r-- | net/zephyr/files/patch-ad | 182 |
1 files changed, 182 insertions, 0 deletions
diff --git a/net/zephyr/files/patch-ad b/net/zephyr/files/patch-ad new file mode 100644 index 000000000000..413bf4fd9b85 --- /dev/null +++ b/net/zephyr/files/patch-ad @@ -0,0 +1,182 @@ +$NetBSD: patch-aa,v 1.2 1998/08/07 11:11:07 agc Exp $ + +*** h/zephyr/zephyr.h.in.orig 1996/06/12 04:42:56 +--- h/zephyr/zephyr.h.in 1996/11/22 22:04:51 +*************** +*** 73,78 **** + /* Unique ID format */ + typedef struct _ZUnique_Id_t { +! struct in_addr zuid_addr; +! struct timeval tv; + } ZUnique_Id_t; + +--- 73,78 ---- + /* Unique ID format */ + typedef struct _ZUnique_Id_t { +! struct in_addr zuid_addr; +! ZEPHYR_INT32 zuid_sec, zuid_usec; + } ZUnique_Id_t; + +*** lib/zephyr/ZParseNot.c.orig 1995/07/18 20:28:07 +--- lib/zephyr/ZParseNot.c 1996/11/22 22:04:52 +*************** +*** 154,161 **** + if (numfields) { + if (ZReadAscii(ptr, end-ptr, (unsigned char *)¬ice->z_uid, +! sizeof(ZUnique_Id_t)) == ZERR_BADFIELD) + BAD_PACKET; +! notice->z_time.tv_sec = ntohl((u_long) notice->z_uid.tv.tv_sec); +! notice->z_time.tv_usec = ntohl((u_long) notice->z_uid.tv.tv_usec); + numfields--; + next_field (ptr); +--- 154,161 ---- + if (numfields) { + if (ZReadAscii(ptr, end-ptr, (unsigned char *)¬ice->z_uid, +! sizeof(notice->z_uid)) == ZERR_BADFIELD) + BAD_PACKET; +! notice->z_time.tv_sec = ntohl((u_long) notice->z_uid.zuid_sec); +! notice->z_time.tv_usec = ntohl((u_long) notice->z_uid.zuid_usec); + numfields--; + next_field (ptr); +*************** +*** 268,275 **** + if (numfields) { + if (ZReadAscii(ptr, end-ptr, (unsigned char *)¬ice->z_multiuid, +! sizeof(ZUnique_Id_t)) == ZERR_BADFIELD) + BAD_PACKET; +! notice->z_time.tv_sec = ntohl((u_long) notice->z_multiuid.tv.tv_sec); +! notice->z_time.tv_usec = ntohl((u_long) notice->z_multiuid.tv.tv_usec); + numfields--; + next_field (ptr); +--- 268,275 ---- + if (numfields) { + if (ZReadAscii(ptr, end-ptr, (unsigned char *)¬ice->z_multiuid, +! sizeof(notice->z_multiuid)) == ZERR_BADFIELD) + BAD_PACKET; +! notice->z_time.tv_sec = ntohl((u_long) notice->z_multiuid.zuid_sec); +! notice->z_time.tv_usec = ntohl((u_long) notice->z_multiuid.zuid_usec); + numfields--; + next_field (ptr); +*** lib/zephyr/Zinternal.c.orig 1995/07/18 20:28:17 +--- lib/zephyr/Zinternal.c 1996/11/22 22:04:52 +*************** +*** 609,612 **** +--- 609,613 ---- + static char version[BUFSIZ]; /* default init should be all \0 */ + struct sockaddr_in name; ++ struct timeval tv; + int namelen = sizeof(name); + +*************** +*** 628,634 **** + notice->z_multinotice = ""; + +! (void) gettimeofday(¬ice->z_uid.tv, (struct timezone *)0); +! notice->z_uid.tv.tv_sec = htonl((u_long) notice->z_uid.tv.tv_sec); +! notice->z_uid.tv.tv_usec = htonl((u_long) notice->z_uid.tv.tv_usec); + + if ((retval = Z_GetMyAddr()) != ZERR_NONE) +--- 629,635 ---- + notice->z_multinotice = ""; + +! (void) gettimeofday(&tv, (struct timezone *)0); +! notice->z_uid.zuid_sec = htonl((u_long) tv.tv_sec); +! notice->z_uid.zuid_usec = htonl((u_long) tv.tv_usec); + + if ((retval = Z_GetMyAddr()) != ZERR_NONE) +*************** +*** 710,715 **** + ptr += strlen(ptr)+1; + +! if (ZMakeAscii(ptr, end-ptr, (unsigned char *)¬ice->z_uid, +! sizeof(ZUnique_Id_t)) == ZERR_FIELDLEN) + return (ZERR_HEADERLEN); + ptr += strlen(ptr)+1; +--- 711,716 ---- + ptr += strlen(ptr)+1; + +! if (ZMakeAscii(ptr, end-ptr, (unsigned char *)¬ice->z_uid, +! sizeof(notice->z_uid)) == ZERR_FIELDLEN) + return (ZERR_HEADERLEN); + ptr += strlen(ptr)+1; +*************** +*** 761,766 **** + return (ZERR_HEADERLEN); + +! if (ZMakeAscii(ptr, end-ptr, (unsigned char *)¬ice->z_multiuid, +! sizeof(ZUnique_Id_t)) == ZERR_FIELDLEN) + return (ZERR_HEADERLEN); + ptr += strlen(ptr)+1; +--- 762,767 ---- + return (ZERR_HEADERLEN); + +! if (ZMakeAscii(ptr, end-ptr, (unsigned char *)¬ice->z_multiuid, +! sizeof(notice->z_multiuid)) == ZERR_FIELDLEN) + return (ZERR_HEADERLEN); + ptr += strlen(ptr)+1; +*************** +*** 882,885 **** +--- 883,887 ---- + int offset, hdrsize, fragsize, ret_len, message_len, waitforack; + Code_t retval; ++ struct timeval tv; + + hdrsize = len-notice->z_message_len; +*************** +*** 897,906 **** + partnotice.z_multinotice = multi; + if (offset > 0) { +! (void) gettimeofday(&partnotice.z_uid.tv, +! (struct timezone *)0); +! partnotice.z_uid.tv.tv_sec = +! htonl((u_long) partnotice.z_uid.tv.tv_sec); +! partnotice.z_uid.tv.tv_usec = +! htonl((u_long) partnotice.z_uid.tv.tv_usec); + if ((retval = Z_GetMyAddr()) != ZERR_NONE) + return (retval); +--- 899,905 ---- + partnotice.z_multinotice = multi; + if (offset > 0) { +! (void) gettimeofday(&tv, (struct timezone *)0); +! partnotice.z_uid.zuid_sec = htonl((u_long) tv.tv_sec); +! partnotice.z_uid.zuid_usec = htonl((u_long) tv.tv_usec); + if ((retval = Z_GetMyAddr()) != ZERR_NONE) + return (retval); +*** server/dispatch.c.orig 1996/06/06 05:56:58 +--- server/dispatch.c 1996/11/22 22:04:52 +*************** +*** 828,834 **** + /* search the not-yet-acked table for this packet, and flush it. */ + #if 0 +! zdbug((LOG_DEBUG, "nack_cancel: %s:%08X,%08X", + inet_ntoa(notice->z_uid.zuid_addr), +! notice->z_uid.tv.tv_sec, notice->z_uid.tv.tv_usec)); + #endif + hashval = NACKTAB_HASHVAL(*who, notice->z_uid); +--- 828,835 ---- + /* search the not-yet-acked table for this packet, and flush it. */ + #if 0 +! zdbug((LOG_DEBUG, "nack_cancel: %s:%08lX,%08lX", + inet_ntoa(notice->z_uid.zuid_addr), +! (u_long) notice->z_uid.zuid_sec, +! (u_long) notice->z_uid.zuid_usec)); + #endif + hashval = NACKTAB_HASHVAL(*who, notice->z_uid); +*************** +*** 846,852 **** + + #if 1 +! zdbug((LOG_DEBUG,"nack_cancel: nack not found %s:%08X,%08X", + inet_ntoa (notice->z_uid.zuid_addr), +! notice->z_uid.tv.tv_sec, notice->z_uid.tv.tv_usec)); + #endif + } +--- 847,854 ---- + + #if 1 +! zdbug((LOG_DEBUG,"nack_cancel: nack not found %s:%08lX,%08lX", + inet_ntoa (notice->z_uid.zuid_addr), +! (u_long) notice->z_uid.zuid_sec, +! (u_long) notice->z_uid.zuid_usec)); + #endif + } |