#!/bin/rc # # command: /bin/boddle /n/juke/plan_9/sys/src/ape/lib/bsd /sys/src/ape/lib/bsd # srcdir: /n/juke/plan_9/sys/src/ape/lib/bsd # version: 827250390 # date: Tue Mar 19 10:46:30 EST 1996 # myname=$0 doextract=no fn usage{ echo $myname: usage: $myname '[-X] [src-directory]' >[1=2] exit usage } fn sigint{ rm -rf 827250390 exit interrupt } while(~ $1 -*){ switch($1){ case -X doextract=yes case -* usage } shift } switch($#*){ case 0 srcdir=/sys/src/ape/lib/bsd case 1 srcdir=$1 case * usage } if(! ~ $doextract yes){ echo This shell file contains a bundle of diffs representing changes echo to original source files in the Plan 9 distribution. It will run echo against the files in echo ' ' $srcdir echo '(unless overridden by the optional source directory argument)' echo and create a directory 827250390 containing the updated files. echo It will NOT automatically update the original files. echo echo Invoke with argument -X to perform the actual extraction. exit 0 } rm -rf 827250390 mkdir 827250390 target=827250390/bind.c echo -n '827250390/bind.c: ' if(! test -f $srcdir/bind.c || ! test -r $srcdir/bind.c){ echo $srcdir/bind.c unreadable exit unreadable } sum=`{sum < $srcdir/bind.c} if(! ~ ba06c6c71197 $sum(1)^$sum(2)){ echo $srcdir/bind.c is not the original distribution file exit original } cp $srcdir/bind.c 827250390/bind.c ed 827250390/bind.c >/dev/null >[2=1] <<'//GO.SYSIN DD VADIM bind.c' 55c sprintf(msg, "bind %d", ntohs(lip->sin_port)); . wq //GO.SYSIN DD VADIM bind.c sum=`{sum < 827250390/bind.c} if(~ e0bd5ae31204 $sum(1)^$sum(2)) echo if not{ echo 827250390/bind.c checksum error creating updated file exit checksum } target=827250390/connect.c echo -n '827250390/connect.c: ' if(! test -f $srcdir/connect.c || ! test -r $srcdir/connect.c){ echo $srcdir/connect.c unreadable exit unreadable } sum=`{sum < $srcdir/connect.c} if(! ~ d3338ce12129 $sum(1)^$sum(2)){ echo $srcdir/connect.c is not the original distribution file exit original } cp $srcdir/connect.c 827250390/connect.c ed 827250390/connect.c >/dev/null >[2=1] <<'//GO.SYSIN DD VADIM connect.c' 57c ntohs(rip->sin_port), . 54c ntohs(lip->sin_port)); . 52c inet_ntoa(rip->sin_addr), ntohs(rip->sin_port), . wq //GO.SYSIN DD VADIM connect.c sum=`{sum < 827250390/connect.c} if(~ fe1109412150 $sum(1)^$sum(2)) echo if not{ echo 827250390/connect.c checksum error creating updated file exit checksum } target=827250390/gettimeofday.c echo -n '827250390/gettimeofday.c: ' if(! test -f $srcdir/gettimeofday.c || ! test -r $srcdir/gettimeofday.c){ echo $srcdir/gettimeofday.c unreadable exit unreadable } sum=`{sum < $srcdir/gettimeofday.c} if(! ~ a0b51b91247 $sum(1)^$sum(2)){ echo $srcdir/gettimeofday.c is not the original distribution file exit original } cp $srcdir/gettimeofday.c 827250390/gettimeofday.c ed 827250390/gettimeofday.c >/dev/null >[2=1] <<'//GO.SYSIN DD VADIM gettimeofday.c' 9c tp->tv_usec = ms() * 1000; . 4a static int ms(void) { char b[20]; static int f = -1; /* XXX - should use native plan9 syscalls herein */ memset(b, 0, sizeof(b)); if (f < 0) { f = open("/dev/msec", O_RDONLY); fcntl(f, FD_CLOEXEC, 1); } if (f >= 0) { lseek(f, 0, 0); read(f, b, sizeof(b)); } return atol(b) % 1000; } . 3a #include #include #include #include . wq //GO.SYSIN DD VADIM gettimeofday.c sum=`{sum < 827250390/gettimeofday.c} if(~ 209e96d9639 $sum(1)^$sum(2)) echo if not{ echo 827250390/gettimeofday.c checksum error creating updated file exit checksum } target=827250390/inet_ntoa.c echo -n '827250390/inet_ntoa.c: ' if(! test -f $srcdir/inet_ntoa.c || ! test -r $srcdir/inet_ntoa.c){ echo $srcdir/inet_ntoa.c unreadable exit unreadable } sum=`{sum < $srcdir/inet_ntoa.c} if(! ~ 82ba51c8388 $sum(1)^$sum(2)){ echo $srcdir/inet_ntoa.c is not the original distribution file exit original } cp $srcdir/inet_ntoa.c 827250390/inet_ntoa.c ed 827250390/inet_ntoa.c >/dev/null >[2=1] <<'//GO.SYSIN DD VADIM inet_ntoa.c' 19c x = ntohl(in.s_addr); . wq //GO.SYSIN DD VADIM inet_ntoa.c sum=`{sum < 827250390/inet_ntoa.c} if(~ 6cf535cb395 $sum(1)^$sum(2)) echo if not{ echo 827250390/inet_ntoa.c checksum error creating updated file exit checksum } target=827250390/listen.c echo -n '827250390/listen.c: ' if(! test -f $srcdir/listen.c || ! test -r $srcdir/listen.c){ echo $srcdir/listen.c unreadable exit unreadable } sum=`{sum < $srcdir/listen.c} if(! ~ 77be54cc2803 $sum(1)^$sum(2)){ echo $srcdir/listen.c is not the original distribution file exit original } cp $srcdir/listen.c 827250390/listen.c ed 827250390/listen.c >/dev/null >[2=1] <<'//GO.SYSIN DD VADIM listen.c' 140c sprintf(msg, "announce %d", ntohs(lip->sin_port)); . wq //GO.SYSIN DD VADIM listen.c sum=`{sum < 827250390/listen.c} if(~ e662301e2810 $sum(1)^$sum(2)) echo if not{ echo 827250390/listen.c checksum error creating updated file exit checksum }