Subject: ntpd, syslog(3), disktab(5), savecore(8) bugs (#268) Index: new/ntp,etc/savecore.c,sys/pdpdist,lib/libc/gen/syslog.c 2.11BSD Description: 1) 'ntpd' fails to sync with time servers and can fill the disk with error messages sent to the logfiles. 2) syslog(3) would cause a SIGSYS to be generated when used with a non networking (GENERIC for example) kernel. 3) savecore(8) fails to create crash dump files. 4) disktab(5) has erroneous information for several disk types. 5) pdpdist/MAKEDEV was about 5 years out of date. Repeat-By: 1) Run /etc/ntpd. Notice that it never synchronizes with any peers. It is not known when ntpd ceased functioning - it did run at one time. There were several cases of "1 << shiftcount" causing total loss of significance - the code should have been "1L << shiftcount". The select call is normally interrupted by a timer going off. In this case the return value from select is -1 but that was not being checked for, resulting in an error message being logged. 2) If syslog(3) is used on a non networking kernel the messages are to be written to a logfile instead of connecting to syslogd. There was a bug present which would cause syslog(3) to perform a connect(2). That would cause the program to be sent a SIGSYS signal usually resulting in a coredump. This was bad news for programs such as 'login' and 'su'. 3) The savecore(8) program broke when sprintf(3) was changed to return 'int' rather than 'char *'. This caused savecore(8) to not create one or both of the core and unix files in /usr/crash. Instead of scanning the /dev directory, stat'ing each file in that directory, the routine 'devname(3)' is used - this looks up the dev_t in the /var/run/dev database. 4) The RD54 entry was incorrect. The geometry and partition sizes are correct but the filesystem type fields were wrong. This was rather embarassing because the RD54 disk was used in the examples. There are two patches for disktab below - one is for the template file in /sys/pdpdist. The second one is for the actual copy of the disktab file in /etc. 5) It was pointed out to me that the MAKEDEV template in /sys/pdpdist was very much out of date (about 5 years as it turns out). The actual /dev/MAKEDEV file is correct and is not affected by this patch. Fix: Cut where indicated and save to a file (/tmp/268). Then: cd /tmp patch -p0 < 268 cd /usr/src/lib/libc/gen make ar r /lib/libc.a *.o cd profiled ar r /usr/lib/libc_p.a *.o cd .. make clean ranlib /lib/libc.a /usr/lib/libc_p.a cd /usr/src/bin/login make make install If you have recompiled/linked other programs, such as "su", and plan on using a non networking kernel you will need to recompile and install those programs now. cd /usr/src/etc make savecore install -s -m 755 savecore /etc/savecore cd /usr/src/new/ntp make make install make clean NOTE: If you have customized /etc/disktab with local information the patch for /etc/disktab will probably fail. This is not cause for alarm - it should be obvious which entries need to be changed manually. =========================cut here================= *** /etc/disktab.old Thu Jun 29 21:05:16 1995 --- /etc/disktab Thu Jul 13 19:36:39 1995 *************** *** 1,4 **** ! # @(#)disktab 1.1 (2.11BSD) 1995/05/11 # # Disk geometry and partition layout tables. # Key: --- 1,4 ---- ! # @(#)disktab 1.2 (2.11BSD) 1995/07/13 # # Disk geometry and partition layout tables. # Key: *************** *** 186,192 **** :b0=/mdec/hkuboot:\ :pa#8316:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ :pb#8316:ob#8316:bb#1024:fb#1024:tb=swap:\ ! :pc#27126:oc#0:bg#1024:fg#1024:\ :pg#10428:og#16632:bg#1024:fg#1024:tg=2.11BSD:\ :ph#27060:oh#0:bh#1024:fh#1024:th=2.11BSD --- 186,192 ---- :b0=/mdec/hkuboot:\ :pa#8316:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ :pb#8316:ob#8316:bb#1024:fb#1024:tb=swap:\ ! :pc#27126:oc#0:bc#1024:fc#1024:tc=unused:\ :pg#10428:og#16632:bg#1024:fg#1024:tg=2.11BSD:\ :ph#27060:oh#0:bh#1024:fh#1024:th=2.11BSD *************** *** 195,202 **** :b0=/mdec/hkuboot:\ :pa#8316:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ :pb#8316:ob#8316:bb#1024:fb#1024:tb=swap:\ ! :pc#53790:oc#0:bc#1024:fc#1024:\ ! :pg#37092:og#16632:bg#1024:fg#1024:tb=2.11BSD:\ :ph#53724:oh#0:bh#1024:fh#1024:th=2.11BSD # The RL02 and RL01 have 256 byte sectors, getdiskbyname ignores 'se' --- 195,202 ---- :b0=/mdec/hkuboot:\ :pa#8316:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ :pb#8316:ob#8316:bb#1024:fb#1024:tb=swap:\ ! :pc#53790:oc#0:bc#1024:fc#1024:tc=unused:\ ! :pg#37092:og#16632:bg#1024:fg#1024:tg=2.11BSD:\ :ph#53724:oh#0:bh#1024:fh#1024:th=2.11BSD # The RL02 and RL01 have 256 byte sectors, getdiskbyname ignores 'se' *************** *** 344,352 **** :dt=MSCP:ty=fixed:ns#17:nt#15:nc#1221:so:\ :b0=/mdec/rauboot:\ :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ ! :pb#16720:ob#15884:bb#1024:fb#1024:ta=swap:\ ! :pc#311200:oc#0:bc#1024:fc#1024:\ ! :pg#278596:og#32604:bg#1024:fg#1024:ta=2.11BSD rx23|RX23|DEC RX23:\ :dt=MSCP:ty=floppy:ns#18:nt#2:nc#80:\ --- 344,352 ---- :dt=MSCP:ty=fixed:ns#17:nt#15:nc#1221:so:\ :b0=/mdec/rauboot:\ :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ ! :pb#16720:ob#15884:bb#1024:fb#1024:tb=swap:\ ! :pc#311200:oc#0:bc#1024:fc#1024:tc=unused:\ ! :pg#278596:og#32604:bg#1024:fg#1024:tg=2.11BSD rx23|RX23|DEC RX23:\ :dt=MSCP:ty=floppy:ns#18:nt#2:nc#80:\ *** /VERSION.old Thu Jun 29 22:14:46 1995 --- /VERSION Sat Jul 15 21:47:15 1995 *************** *** 1,4 **** ! Current Patch Level: 267 2.11 BSD ============ --- 1,4 ---- ! Current Patch Level: 268 2.11 BSD ============ *** /usr/src/sys/pdpdist/disktab.old Thu Jun 29 21:05:57 1995 --- /usr/src/sys/pdpdist/disktab Thu Jul 13 19:36:39 1995 *************** *** 1,4 **** ! # @(#)disktab 1.1 (2.11BSD) 1995/05/11 # # Disk geometry and partition layout tables. # Key: --- 1,4 ---- ! # @(#)disktab 1.2 (2.11BSD) 1995/07/13 # # Disk geometry and partition layout tables. # Key: *************** *** 186,192 **** :b0=/mdec/hkuboot:\ :pa#8316:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ :pb#8316:ob#8316:bb#1024:fb#1024:tb=swap:\ ! :pc#27126:oc#0:bg#1024:fg#1024:\ :pg#10428:og#16632:bg#1024:fg#1024:tg=2.11BSD:\ :ph#27060:oh#0:bh#1024:fh#1024:th=2.11BSD --- 186,192 ---- :b0=/mdec/hkuboot:\ :pa#8316:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ :pb#8316:ob#8316:bb#1024:fb#1024:tb=swap:\ ! :pc#27126:oc#0:bc#1024:fc#1024:tc=unused:\ :pg#10428:og#16632:bg#1024:fg#1024:tg=2.11BSD:\ :ph#27060:oh#0:bh#1024:fh#1024:th=2.11BSD *************** *** 195,202 **** :b0=/mdec/hkuboot:\ :pa#8316:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ :pb#8316:ob#8316:bb#1024:fb#1024:tb=swap:\ ! :pc#53790:oc#0:bc#1024:fc#1024:\ ! :pg#37092:og#16632:bg#1024:fg#1024:tb=2.11BSD:\ :ph#53724:oh#0:bh#1024:fh#1024:th=2.11BSD # The RL02 and RL01 have 256 byte sectors, getdiskbyname ignores 'se' --- 195,202 ---- :b0=/mdec/hkuboot:\ :pa#8316:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ :pb#8316:ob#8316:bb#1024:fb#1024:tb=swap:\ ! :pc#53790:oc#0:bc#1024:fc#1024:tc=unused:\ ! :pg#37092:og#16632:bg#1024:fg#1024:tg=2.11BSD:\ :ph#53724:oh#0:bh#1024:fh#1024:th=2.11BSD # The RL02 and RL01 have 256 byte sectors, getdiskbyname ignores 'se' *************** *** 344,352 **** :dt=MSCP:ty=fixed:ns#17:nt#15:nc#1221:so:\ :b0=/mdec/rauboot:\ :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ ! :pb#16720:ob#15884:bb#1024:fb#1024:ta=swap:\ ! :pc#311200:oc#0:bc#1024:fc#1024:\ ! :pg#278596:og#32604:bg#1024:fg#1024:ta=2.11BSD rx23|RX23|DEC RX23:\ :dt=MSCP:ty=floppy:ns#18:nt#2:nc#80:\ --- 344,352 ---- :dt=MSCP:ty=fixed:ns#17:nt#15:nc#1221:so:\ :b0=/mdec/rauboot:\ :pa#15884:oa#0:ba#1024:fa#1024:ta=2.11BSD:\ ! :pb#16720:ob#15884:bb#1024:fb#1024:tb=swap:\ ! :pc#311200:oc#0:bc#1024:fc#1024:tc=unused:\ ! :pg#278596:og#32604:bg#1024:fg#1024:tg=2.11BSD rx23|RX23|DEC RX23:\ :dt=MSCP:ty=floppy:ns#18:nt#2:nc#80:\ *** /usr/src/sys/pdpdist/MAKEDEV.old Thu Aug 23 18:21:21 1990 --- /usr/src/sys/pdpdist/MAKEDEV Sat Jun 17 23:47:20 1995 *************** *** 4,10 **** # All rights reserved. The Berkeley software License Agreement # specifies the terms and conditions for redistribution. # ! # @(#)MAKEDEV 4.27 (Berkeley) 4/15/86 # # Device "make" file. Valid arguments: # std standard devices --- 4,10 ---- # All rights reserved. The Berkeley software License Agreement # specifies the terms and conditions for redistribution. # ! # @(#)MAKEDEV 4.27.2 (2.11BSD GTE) 1995/06/17 # # Device "make" file. Valid arguments: # std standard devices *************** *** 24,34 **** --- 24,36 ---- # si* unibus cdc 9766 w/ si 9500 # xp* unibus rm02/03/05, rp04/05/06, diva, eagle, cdc9766, fuji 160. # Terminal multiplexors: + # dl* dl-11 units other than the console # dz* unibus dz11 and dz32 # dh* unibus dh11 and emulations (e.g. Able dmax, Emulex cs-11) # dmf* unibus dmf32 # dhu* unibus dhu11 # dmz* unibus dmz32 + # dhv* qbus dhv11 # Pseudo terminals: # pty* set of 16 master and slave pseudo terminals # Printers: *************** *** 37,45 **** # vp* unibus versatec parallel interface # Call units: # Special purpose devices: ! # dr* unibus dr11 ! # ram* memory disk ! # dn* dn11 dialer umask 77 for i do --- 39,49 ---- # vp* unibus versatec parallel interface # Call units: # Special purpose devices: ! # dr* unibus dr11 ! # ram* memory disk ! # dn* dn11 dialer ! # ingreslock Ingres lock driver. ! umask 77 for i do *************** *** 56,105 **** ;; ht*|tm*|ts*|tu*) ! umask 0 ; unit=`expr $i : '..\(.*\)'` case $i in ! ht*) blk=0; chr=6 ;; tm*) blk=1; chr=7;; ts*) blk=2; chr=8;; tu*) blk=12; chr=23;; esac ! case $unit in ! 0|1|2|3) ! four=`expr $unit + 4` ; eight=`expr $unit + 8` ! twelve=`expr $unit + 12`; twenty=`expr $unit + 20` ! /etc/mknod mt$unit b $blk $unit /etc/mknod mt$four b $blk $four /etc/mknod mt$eight b $blk $eight /etc/mknod mt$twelve b $blk $twelve ! /etc/mknod nmt$unit b $blk $four ;: sanity w/pdp11 v7 /etc/mknod nmt$eight b $blk $twelve ;: ditto ! /etc/mknod nrmt$unit c $chr $four ;: sanity w/pdp11 v7 /etc/mknod nrmt$eight c $chr $twelve ;: ditto ! /etc/mknod rmt$unit c $chr $unit /etc/mknod rmt$four c $chr $four /etc/mknod rmt$eight c $chr $eight /etc/mknod rmt$twelve c $chr $twelve ! if [ $i = ut ] then /etc/mknod mt$twenty b $blk $twenty /etc/mknod rmt$twenty c $chr $twenty fi ;; *) ! echo bad unit for tape in: $1 ;; esac umask 77 ;; ! rk*|rl*) ! # The 2.10BSD rk and rl drivers don't support partitions. We create # a single block and charater inode pair for each unit and ! # call it rkNh and rlNh. umask 2 ; unit=`expr $i : '..\(.*\)'` case $i in rk*) name=rk; blk=6; chr=15;; - rl*) name=rl; blk=7; chr=16;; esac /etc/mknod ${name}${unit}h b ${blk} ${unit} /etc/mknod r${name}${unit}h c ${chr} ${unit} --- 60,135 ---- ;; ht*|tm*|ts*|tu*) ! umask 0 ; ctlr=`expr $i : '..\(.*\)'` ! ctlr=`expr $ctlr '*' 64` case $i in ! ht*) blk=0; chr=6;; tm*) blk=1; chr=7;; ts*) blk=2; chr=8;; tu*) blk=12; chr=23;; esac ! # Maximum of 4 controllers in a system ! case $ctlr in ! 0|64|128|192) ! # Maximum of 4 units per controller ! # for unit in 0 1 2 3 ! for unit in 0 1 ! do ! zero=`expr $ctlr + $unit + 0` ! four=`expr $zero + 4` ; eight=`expr $zero + 8` ! twelve=`expr $zero + 12` ! sixteen=`expr $zero + 16` ! twenty=`expr $zero + 20` ! twentyfour=`expr $zero + 24` ! twentyeight=`expr $zero + 28` ! /etc/mknod mt$zero b $blk $zero /etc/mknod mt$four b $blk $four /etc/mknod mt$eight b $blk $eight /etc/mknod mt$twelve b $blk $twelve ! /etc/mknod nmt$zero b $blk $four ;: v7 compatibility /etc/mknod nmt$eight b $blk $twelve ;: ditto ! /etc/mknod nrmt$zero c $chr $four ;: ditto /etc/mknod nrmt$eight c $chr $twelve ;: ditto ! /etc/mknod rmt$zero c $chr $zero /etc/mknod rmt$four c $chr $four /etc/mknod rmt$eight c $chr $eight /etc/mknod rmt$twelve c $chr $twelve ! if [ `expr $i : '\(..\)'` = tu ] then + /etc/mknod mt$sixteen b $blk $sixteen + /etc/mknod mt$twenty b $blk $twenty + /etc/mknod mt$twentyfour b $blk $twentyfour + /etc/mknod mt$twentyeight b $blk $twentyeight + /etc/mknod nmt$sixteen b $blk $twenty ;: v7 compatibility + /etc/mknod nmt$twentyfour b $blk $twentyeight ;: ditto + /etc/mknod nrmt$sixteen c $chr $twenty ;: ditto + /etc/mknod nrmt$twentyfour c $chr $twentyeight ;: ditto + /etc/mknod rmt$sixteen c $chr $sixteen + /etc/mknod rmt$twenty c $chr $twenty + /etc/mknod rmt$twentyfour c $chr $twentyfour + /etc/mknod rmt$twentyeight c $chr $twentyeight + fi + if [ `expr $i : '\(..\)'` = ut ] + then /etc/mknod mt$twenty b $blk $twenty /etc/mknod rmt$twenty c $chr $twenty fi + done ;; *) ! echo bad controller for tape in: $1 ;; esac umask 77 ;; ! rk*) ! # The 2.11BSD rk driver doesn't support partitions. We create # a single block and charater inode pair for each unit and ! # call it rkNh. umask 2 ; unit=`expr $i : '..\(.*\)'` case $i in rk*) name=rk; blk=6; chr=15;; esac /etc/mknod ${name}${unit}h b ${blk} ${unit} /etc/mknod r${name}${unit}h c ${chr} ${unit} *************** *** 133,139 **** umask 77 ;; ! br*|hk*|ra*|si*|xp*) umask 2 ; unit=`expr $i : '..\(.*\)'` case $i in br*) name=rp; blk=11; chr=20;; --- 163,169 ---- umask 77 ;; ! br*|hk*|ra*|si*|xp*|rl*) umask 2 ; unit=`expr $i : '..\(.*\)'` case $i in br*) name=rp; blk=11; chr=20;; *************** *** 141,146 **** --- 171,177 ---- ra*) name=ra; blk=5; chr=14;; si*) name=si; blk=9; chr=18;; xp*) name=xp; blk=10; chr=19;; + rl*) name=rl; blk=7; chr=16;; esac case $unit in 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|\ *************** *** 188,194 **** # # we may want dmz and dmf someday... # dhu*|dh*|dmf*|dmz*) ! dhu*|dh*) case $i in # dmz*) name=dmz; major=37; count=24; # unit=`expr $i : "$name\(.*\)"` --- 219,225 ---- # # we may want dmz and dmf someday... # dhu*|dh*|dmf*|dmz*) ! dhv*|dhu*|dh*) case $i in # dmz*) name=dmz; major=37; count=24; # unit=`expr $i : "$name\(.*\)"` *************** *** 204,209 **** --- 235,247 ---- # 4) ch=F ;; 5) ch=G ;; 6) ch=H ;; 7) ch=I ;; # *) echo bad unit for $name in: $i ;; # esac;; + dhv*) name=dhv; major=24; count=8; + unit=`expr $i : "$name\(.*\)"`; + case $unit in + 0) ch=S ;; 1) ch=T ;; 2) ch=U ;; 3) ch=V ;; + 4) ch=W ;; 5) ch=X ;; 6) ch=Y ;; 7) ch=Z ;; + *) echo bad unit for $name in: $i ;; + esac;; dhu*) name=dhu; major=4; count=16; unit=`expr $i : "$name\(.*\)"`; case $unit in *************** *** 215,221 **** unit=`expr $i : "$name\(.*\)"` case $unit in 0) ch=h ;; 1) ch=i ;; 2) ch=j ;; 3) ch=k ;; - 4) ch=l ;; 5) ch=m ;; 6) ch=n ;; 7) ch=o ;; *) echo bad unit for $name in: $i ;; esac;; esac --- 253,258 ---- *************** *** 228,239 **** printf("/etc/mknod tty%s%c c %d %d; ",ch,87+i,m,u+i); }'` ;; # we may want va and vp someday... # lp*|va*|vp*) lp*|dn*) case $i in lp*) name=lp; major=5;; ! dn*) name=dn; major=21; # va*) name=va; major=10;; # vp*) name=vp; major=6;; esac --- 265,295 ---- printf("/etc/mknod tty%s%c c %d %d; ",ch,87+i,m,u+i); }'` ;; + # extra DL-11 units not including the console. unit numbers start at 1 because + # the console is always unit 0. Seven units (1 - 7) are defined for the 11/93 + # and 11/94. Device name is "ttyl?". The DH range was restricted from 'h'-'o' + # to 'h' - 'k' (very unlikely that more than 64 channels of DH-11 will or could + # be put on an 11. + + dl*) + name=dl; major=0; ch=l + unit=`expr $i : "$name\(.*\)"` + case $unit in + 1|2|3|4|5|6|7) + /etc/mknod tty${ch}${unit} c $major $unit; + ;; + *) + echo bad unit for $name in: $i + ;; + esac + ;; + # we may want va and vp someday... # lp*|va*|vp*) lp*|dn*) case $i in lp*) name=lp; major=5;; ! dn*) name=dn; major=21;; # va*) name=va; major=10;; # vp*) name=vp; major=6;; esac *************** *** 288,293 **** --- 344,355 ---- echo bad unit for ${name} in: $i ;; esac + ;; + + ingreslock) + mknod ingreslock c 25 0 + chown ingres ingreslock + chmod 200 ingreslock ;; local) *** /usr/src/etc/savecore.c.old Sun Jan 16 21:37:22 1994 --- /usr/src/etc/savecore.c Sat Jul 15 21:44:53 1995 *************** *** 1,11 **** /* ! * savecore */ #include #include #include - #include #include #include #include --- 1,10 ---- /* ! * savecore, 1.1 (2.11BSD) 1995/07/15 */ #include #include #include #include #include #include *************** *** 53,65 **** size_t physmem; /* amount of memory in machine */ time_t now; /* current date */ char *path(); ! char *malloc(); ! char *ctime(); char vers[80]; char core_vers[80]; char panic_mesg[80]; int panicstr; ! off_t lseek(); off_t Lseek(); int debug; --- 52,65 ---- size_t physmem; /* amount of memory in machine */ time_t now; /* current date */ char *path(); ! extern char *malloc(); ! extern char *ctime(); char vers[80]; char core_vers[80]; char panic_mesg[80]; int panicstr; ! extern off_t lseek(); ! extern char *devname(); off_t Lseek(); int debug; *************** *** 97,135 **** char * find_dev(dev, type) register dev_t dev; ! register int type; ! { ! register DIR *dfd = opendir("/dev"); ! struct direct *dir; ! struct stat statb; ! static char devname[MAXNAMLEN + 6]; ! char *dp; ! strcpy(devname, "/dev/"); ! while(dir = readdir(dfd)) { ! if (dir->d_ino == 0) ! continue; ! strncpy(devname + 5, dir->d_name, MAXNAMLEN); ! devname[MAXNAMLEN + 5] = '\0'; ! if (stat(devname, &statb)) { ! perror(devname); ! continue; } ! if ((statb.st_mode&S_IFMT) != type) ! continue; ! if (dev == statb.st_rdev) { ! closedir(dfd); ! dp = (char *)malloc(strlen(devname)+1); ! strcpy(dp, devname); ! return (dp); ! } } - closedir(dfd); - if (debug) - fprintf(stderr, "Can't find device %d,%d\n", - major(dev), minor(dev)); - return(NULL); - } read_kmem() { --- 97,118 ---- char * find_dev(dev, type) register dev_t dev; ! int type; ! { ! register char *dp, *cp; ! cp = devname(dev, type); ! if (!cp) ! { ! if (debug) ! fprintf(stderr, "Can't find device %d,%d\n", ! major(dev), minor(dev)); ! return(NULL); } ! dp = (char *)malloc(strlen(cp) + 1 + sizeof ("/dev/")); ! (void)sprintf(dp, "/dev/%s", cp); ! return(dp); } read_kmem() { *************** *** 164,170 **** exit(1); } kmem = Open("/dev/kmem", 0); ! Lseek(kmem, (long)nl[X_DUMPDEV].n_value, 0); Read(kmem, (char *)&dumpdev, sizeof dumpdev); if (dumpdev == NODEV) { if (debug) --- 147,153 ---- exit(1); } kmem = Open("/dev/kmem", 0); ! Lseek(kmem, (off_t)nl[X_DUMPDEV].n_value, 0); Read(kmem, (char *)&dumpdev, sizeof dumpdev); if (dumpdev == NODEV) { if (debug) *************** *** 171,182 **** fprintf(stderr, "Dumpdev is NODEV\n"); return(0); } ! Lseek(kmem, (long)nl[X_DUMPLO].n_value, 0); Read(kmem, (char *)&dumplo, sizeof dumplo); ! Lseek(kmem, (long)nl[X_PHYSMEM].n_value, 0); Read(kmem, (char *)&physmem, sizeof physmem); if (nl[X_BOOTIME].n_value != 0) { ! Lseek(kmem, (long)nl[X_BOOTIME].n_value, 0); Read(kmem, (char *)&boottime, sizeof boottime); } dumplo *= (long)NBPG; --- 154,165 ---- fprintf(stderr, "Dumpdev is NODEV\n"); return(0); } ! Lseek(kmem, (off_t)nl[X_DUMPLO].n_value, 0); Read(kmem, (char *)&dumplo, sizeof dumplo); ! Lseek(kmem, (off_t)nl[X_PHYSMEM].n_value, 0); Read(kmem, (char *)&physmem, sizeof physmem); if (nl[X_BOOTIME].n_value != 0) { ! Lseek(kmem, (off_t)nl[X_BOOTIME].n_value, 0); Read(kmem, (char *)&boottime, sizeof boottime); } dumplo *= (long)NBPG; *************** *** 223,229 **** { int dumpfd; time_t clobber = (time_t)0; - time_t diff; if (dumpdev == NODEV) return (0); --- 206,211 ---- *************** *** 286,292 **** } ddev = find_dev(dsb.st_dev, S_IFBLK); dfd = Open(ddev, 0); ! Lseek(dfd, (long)SUPERB*DEV_BSIZE, 0); Read(dfd, (char *)&sblk, sizeof sblk); close(dfd); if (read_number("minfree") > sblk.fs_tfree) { --- 268,274 ---- } ddev = find_dev(dsb.st_dev, S_IFBLK); dfd = Open(ddev, 0); ! Lseek(dfd, (off_t)SUPERB*DEV_BSIZE, 0); Read(dfd, (char *)&sblk, sizeof sblk); close(dfd); if (read_number("minfree") > sblk.fs_tfree) { *************** *** 318,340 **** { register int n; char buffer[BLOCK*CLICK]; ! register char *cp = buffer; register int ifd, ofd, bounds; ! register FILE *fp; bounds = read_number("bounds"); ifd = Open(system ? system : "/unix", 0); ! ofd = Create(path(sprintf(cp, "unix.%d", bounds)), 0666); while((n = Read(ifd, buffer, sizeof buffer)) > 0) Write(ofd, cp, n); close(ifd); close(ofd); ifd = Open(ddname, 0); ! ofd = Create(path(sprintf(cp, "core.%d", bounds)), 0666); Lseek(ifd, (off_t)dumplo, 0); printf("Saving %D bytes of image in core.%d\n", (long)CLICK*physmem, bounds); ! while(physmem > 0) { n = Read(ifd, cp, (physmem>BLOCK? BLOCK: physmem) * CLICK); if (n<0) { perror("Read"); --- 300,324 ---- { register int n; char buffer[BLOCK*CLICK]; ! char *cp = buffer; register int ifd, ofd, bounds; ! FILE *fp; bounds = read_number("bounds"); ifd = Open(system ? system : "/unix", 0); ! (void)sprintf(cp, "unix.%d", bounds); ! ofd = Create(path(cp), 0666); while((n = Read(ifd, buffer, sizeof buffer)) > 0) Write(ofd, cp, n); close(ifd); close(ofd); ifd = Open(ddname, 0); ! (void)sprintf(cp, "core.%d", bounds); ! ofd = Create(path(cp), 0666); Lseek(ifd, (off_t)dumplo, 0); printf("Saving %D bytes of image in core.%d\n", (long)CLICK*physmem, bounds); ! while (physmem) { n = Read(ifd, cp, (physmem>BLOCK? BLOCK: physmem) * CLICK); if (n<0) { perror("Read"); *************** *** 343,361 **** Write(ofd, cp, n); physmem -= n/CLICK; } - #ifdef notdef - /* - * Copy the saved registers from their current location to location 4 - * (where a tape dump would have put them). - * - * Update: we always save in 0300 now; adb and the kernel have been - * fixed. Casey Leedom - */ - Lseek(ifd, (off_t)dumplo+REGLOC, 0); - Lseek(ofd, (off_t) 4, 0); - n = read(ifd, buffer, NREGS * sizeof(int)); - write(ofd, buffer, n); - #endif close(ifd); close(ofd); fp = fopen(path("bounds"), "w"); --- 327,332 ---- *************** *** 425,433 **** off_t Lseek(fd, off, flag) int fd, flag; ! long off; { ! long ret; if ((ret = lseek(fd, off, flag)) == -1L) { perror("lseek"); --- 396,404 ---- off_t Lseek(fd, off, flag) int fd, flag; ! off_t off; { ! off_t ret; if ((ret = lseek(fd, off, flag)) == -1L) { perror("lseek"); *** /usr/src/lib/libc/gen/syslog.c.old Thu May 4 21:50:31 1995 --- /usr/src/lib/libc/gen/syslog.c Sat Jul 15 20:50:18 1995 *************** *** 32,38 **** */ #if defined(LIBC_SCCS) && !defined(lint) ! static char sccsid[] = "@(#)syslog.c 8.4.2 (2.11BSD) 1995/05/04"; #endif /* LIBC_SCCS and not lint */ #include --- 32,38 ---- */ #if defined(LIBC_SCCS) && !defined(lint) ! static char sccsid[] = "@(#)syslog.c 8.4.3 (2.11BSD) 1995/07/15"; #endif /* LIBC_SCCS and not lint */ #include *************** *** 226,231 **** --- 226,232 ---- if (LogFile == -1) { LogFile = open(logfile, O_WRONLY|O_APPEND); ToFile = 1; + connected = 1; } else ToFile = 0; *** /usr/src/new/ntp/ntpd.c.old Tue Jan 31 21:09:10 1995 --- /usr/src/new/ntp/ntpd.c Sat Jul 1 12:18:06 1995 *************** *** 1,5 **** #if !defined(lint) && defined(DOSCCS) ! static char *rcsid = "$Source: /usr/src/new/ntp/ntpd.c,v $ $Revision: 3.4.1.11 $ $Date: 95/01/31 20:35:17 $"; #endif lint /* --- 1,5 ---- #if !defined(lint) && defined(DOSCCS) ! static char *rcsid = "$Source: /usr/src/new/ntp/ntpd.c,v $ $Revision: 3.4.1.12 $ $Date: 95/07/1 20:35:17 $"; #endif lint /* *************** *** 389,395 **** (struct timeval *) 0); (void) gettimeofday(&tv, (struct timezone *) 0); ! for(i = 0; i < nintf && nfds; i++) { if (!FD_ISSET(addrs[i].fd, &readfds)) continue; addrs[i].uses++; --- 389,395 ---- (struct timeval *) 0); (void) gettimeofday(&tv, (struct timezone *) 0); ! for(i = 0; i < nintf && nfds > 0; i++) { if (!FD_ISSET(addrs[i].fd, &readfds)) continue; addrs[i].uses++; *************** *** 400,406 **** (struct sockaddr *) dst, &dstlen)) < 0) { if (errno != EWOULDBLOCK) { ! syslog("recvfrom: %m"); #ifdef DEBUG if(debug > 2) perror("recvfrom"); --- 400,406 ---- (struct sockaddr *) dst, &dstlen)) < 0) { if (errno != EWOULDBLOCK) { ! syslog(LOG_NOTICE, "recvfrom: %m"); #ifdef DEBUG if(debug > 2) perror("recvfrom"); *** /usr/src/new/ntp/ntp_proto.c.old Sat Jul 22 22:34:39 1989 --- /usr/src/new/ntp/ntp_proto.c Sat Jul 1 13:24:29 1995 *************** *** 1,5 **** ! #ifndef lint ! static char *rcsid = "$Source: /usr/users/louie/ntp/RCS/ntp_proto.c,v $ $Revision: 3.4.1.12 $ $Date: 89/05/18 18:25:04 $"; #endif /* --- 1,5 ---- ! #if defined(DOSCCS) && !defined(lint) ! static char *rcsid = "$Source: /usr/users/louie/ntp/RCS/ntp_proto.c,v $ $Revision: 3.4.1.13 $ $Date: 95/07/01 18:25:04 $"; #endif /* *************** *** 11,16 **** --- 11,19 ---- /* * $Log: ntp_proto.c,v $ + * Revision 3.4.1.13 95/07/01 + * Fix shifting 1 to 0 with "1<precision < 0 && -sel_lst[i].peer->precision < sizeof(long)*NBBY) precision_thres += ! 1.0/(1<<-sel_lst[i].peer->precision); sel_lst[i].precision = precision_thres; --- 1099,1109 ---- around.. */ sel_lst[i].distance = dispersion; ! precision_thres = NTP_MAXSKW + 1.0/(u_long)(1L<<-sys.precision); if (sel_lst[i].peer->precision < 0 && -sel_lst[i].peer->precision < sizeof(long)*NBBY) precision_thres += ! 1.0/(u_long)(1L<<-sel_lst[i].peer->precision); sel_lst[i].precision = precision_thres;