projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
BSD 4_2 release
[unix-history]
/
usr
/
src
/
usr.bin
/
uucp
/
pk0.c
diff --git
a/usr/src/usr.bin/uucp/pk0.c
b/usr/src/usr.bin/uucp/pk0.c
index
863daf4
..
706010e
100644
(file)
--- a/
usr/src/usr.bin/uucp/pk0.c
+++ b/
usr/src/usr.bin/uucp/pk0.c
@@
-1,12
+1,19
@@
-static char sccsid[] = "%W% (Berkeley) %G%";
+#ifndef lint
+static char sccsid[] = "@(#)pk0.c 5.1 (Berkeley) 7/2/83";
+#endif
+
+extern char *malloc();
#define USER 1
#include <stdio.h>
#define USER 1
#include <stdio.h>
+#ifdef SYSIII
+#include <sys/types.h>
+#endif
+#include "pk.p"
#include <sys/param.h>
#include <sys/param.h>
+#include "pk.h"
#include <sys/buf.h>
#include <sys/buf.h>
-#include "pk.p"
-#include "pk.h"
/*
* packet driver
/*
* packet driver
@@
-17,7
+24,14
@@
char mask[8] ={ 1,2,4,010,020,040,0100,0200 };
struct pack *pklines[NPLINES];
struct pack *pklines[NPLINES];
-
+/*
+ * Here are a couple of strange variables (rti!trt).
+ * pkactive is only incremented in pkopen.
+ * perhaps it should be decremented in pkclose?
+ * And pkdebug is set in gio.c but never used.
+ */
+int pkactive;
+int pkdebug;
/*
* receive control messages
/*
* receive control messages
@@
-131,7
+145,7
@@
unsigned short sum;
/*
* determine input window in m.
*/
/*
* determine input window in m.
*/
- t = (~(-1<<
pk->p_rwindow
)) <<x;
+ t = (~(-1<<
(int)(pk->p_rwindow)
)) <<x;
m = t;
m |= t>>8;
m = t;
m |= t>>8;
@@
-276,7
+290,7
@@
char *cp, **bp;
cp = pk->p_ib[x];
if (is & B_SHORT) {
if (*cp++ & 0200)
cp = pk->p_ib[x];
if (is & B_SHORT) {
if (*cp++ & 0200)
-
*
cp++;
+ cp++;
}
}
IOMOVE(cp,cc,B_READ);
}
}
IOMOVE(cp,cc,B_READ);
@@
-317,7
+331,6
@@
register x;
int partial;
caddr_t cp;
int cc, s, fc, count;
int partial;
caddr_t cp;
int cc, s, fc, count;
-int pktimeout();
pk = PADDR;
if (pk->p_state&DOWN || !pk->p_state&LIVE) {
pk = PADDR;
if (pk->p_state&DOWN || !pk->p_state&LIVE) {
@@
-604,15
+617,14
@@
chksum(s,n)
register char *s;
register n;
{
register char *s;
register n;
{
- register short sum;
- register unsigned short t;
- register short x;
+ register unsigned sum, t;
+ register x;
sum = -1;
x = 0;
do {
sum = -1;
x = 0;
do {
- if (sum
<
0) {
+ if (sum
&0x800
0) {
sum <<= 1;
sum++;
} else
sum <<= 1;
sum++;
} else
@@
-620,12
+632,12
@@
register n;
t = sum;
sum += (unsigned)*s++ & 0377;
x += sum^n;
t = sum;
sum += (unsigned)*s++ & 0377;
x += sum^n;
- if ((
unsigned)sum <= t
) {
+ if ((
sum&0xffff) <= (t&0xffff)
) {
sum ^= x;
}
} while (--n > 0);
sum ^= x;
}
} while (--n > 0);
- return(sum);
+ return(sum
& 0xffff
);
}
pkline(pk)
}
pkline(pk)