diff options
Diffstat (limited to 'sbin')
75 files changed, 490 insertions, 490 deletions
diff --git a/sbin/adjkerntz/adjkerntz.c b/sbin/adjkerntz/adjkerntz.c index d5e10f8..8a3e222 100644 --- a/sbin/adjkerntz/adjkerntz.c +++ b/sbin/adjkerntz/adjkerntz.c @@ -97,7 +97,7 @@ int main(argc, argv) } if (init == -1) goto usage; - + if (access(_PATH_CLOCK, F_OK)) return 0; diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c index e5ae274..43d5ca4 100644 --- a/sbin/bsdlabel/bsdlabel.c +++ b/sbin/bsdlabel/bsdlabel.c @@ -705,7 +705,7 @@ display(f, lp) case FS_BSDLFS: fprintf(f, " %5d %5d %5d", - pp->p_fsize, pp->p_fsize * pp->p_frag, + pp->p_fsize, pp->p_fsize * pp->p_frag, pp->p_cpg); break; @@ -720,7 +720,7 @@ display(f, lp) else putc(' ', f); fprintf(f, "- %d", - (pp->p_offset + + (pp->p_offset + pp->p_size + lp->d_secpercyl - 1) / lp->d_secpercyl - 1); if (pp->p_size % lp->d_secpercyl) diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c index e5ae274..43d5ca4 100644 --- a/sbin/disklabel/disklabel.c +++ b/sbin/disklabel/disklabel.c @@ -705,7 +705,7 @@ display(f, lp) case FS_BSDLFS: fprintf(f, " %5d %5d %5d", - pp->p_fsize, pp->p_fsize * pp->p_frag, + pp->p_fsize, pp->p_fsize * pp->p_frag, pp->p_cpg); break; @@ -720,7 +720,7 @@ display(f, lp) else putc(' ', f); fprintf(f, "- %d", - (pp->p_offset + + (pp->p_offset + pp->p_size + lp->d_secpercyl - 1) / lp->d_secpercyl - 1); if (pp->p_size % lp->d_secpercyl) diff --git a/sbin/dset/dset.c b/sbin/dset/dset.c index 4b78369..81ca715 100644 --- a/sbin/dset/dset.c +++ b/sbin/dset/dset.c @@ -55,7 +55,7 @@ struct nlist nlk[] = { int quiet = FALSE; -void +void fatal(name, str) char *name, *str; { @@ -68,7 +68,7 @@ fatal(name, str) exit(1); } -void +void error(name, str) char *name, *str; { @@ -186,7 +186,7 @@ main(ac, av) fatal("kvmread", NULL); dev_found = 0; - while(pos_t!=NULL) { + while(pos_t!=NULL) { if (kvm_read(kd, pos_t, &buf1, sizeof(struct isa_device)) < 0) fatal("kvmread", NULL); @@ -222,7 +222,7 @@ main(ac, av) if (buf1.id_id != 0) if (verbose) printf( - "kernel: id=%u io=%X irq=%d drq=%d maddr=%X msize=%d flags=%X enabled=%X \n", + "kernel: id=%u io=%X irq=%d drq=%d maddr=%X msize=%d flags=%X enabled=%X \n", buf1.id_id, buf1.id_iobase, buf1.id_irq, buf1.id_drq, buf1.id_maddr, buf1.id_msize, buf1.id_flags, buf1.id_enabled); diff --git a/sbin/dump/dump.h b/sbin/dump/dump.h index 9060b00..f74e83f 100644 --- a/sbin/dump/dump.h +++ b/sbin/dump/dump.h @@ -108,7 +108,7 @@ int mapdirs __P((ino_t maxino, long *tapesize)); /* file dumping routines */ void blksout __P((daddr_t *blkp, int frags, ino_t ino)); -void bread __P((daddr_t blkno, char *buf, int size)); +void bread __P((daddr_t blkno, char *buf, int size)); void dumpino __P((struct dinode *dp, ino_t ino)); void dumpmap __P((char *map, int type, ino_t ino)); void writeheader __P((ino_t ino)); diff --git a/sbin/dump/main.c b/sbin/dump/main.c index db7c41c..8c71021 100644 --- a/sbin/dump/main.c +++ b/sbin/dump/main.c @@ -93,7 +93,7 @@ main(argc, argv) char **argv; { register ino_t ino; - register int dirty; + register int dirty; register struct dinode *dp; register struct fstab *dt; register char *map; @@ -359,7 +359,7 @@ main(argc, argv) the end of each block written, and not in mid-block. Assume no erroneous blocks; this can be compensated for with an artificially low tape size. */ - fetapes = + fetapes = ( tapesize /* blocks */ * TP_BSIZE /* bytes/block */ * (1.0/density) /* 0.1" / byte */ diff --git a/sbin/dump/optr.c b/sbin/dump/optr.c index 6db0908..303b5b3 100644 --- a/sbin/dump/optr.c +++ b/sbin/dump/optr.c @@ -171,7 +171,7 @@ struct group *gp; /* * Get the names from the group entry "operator" to notify. - */ + */ void set_operators() { @@ -300,7 +300,7 @@ timeest() if (tnow >= tschedule) { tschedule = tnow + 300; if (blockswritten < 500) - return; + return; deltat = tstart_writing - tnow + (1.0 * (tnow - tstart_writing)) / blockswritten * tapesize; diff --git a/sbin/dump/tape.c b/sbin/dump/tape.c index f6a4e5b..a7ceba5 100644 --- a/sbin/dump/tape.c +++ b/sbin/dump/tape.c @@ -318,12 +318,12 @@ trewind() for (f = 0; f < SLAVES; f++) { /* - * Drain the results, but unlike EOT we DO (or should) care - * what the return values were, since if we detect EOT after - * we think we've written the last blocks to the tape anyway, + * Drain the results, but unlike EOT we DO (or should) care + * what the return values were, since if we detect EOT after + * we think we've written the last blocks to the tape anyway, * we have to replay those blocks with rollforward. * - * fixme: punt for now. + * fixme: punt for now. */ if (slaves[f].sent) { if (atomic(read, slaves[f].fd, (char *)&got, sizeof got) @@ -391,9 +391,9 @@ rollforward() ntb = (union u_spcl *)tslp->tblock[1]; /* - * Each of the N slaves should have requests that need to - * be replayed on the next tape. Use the extra slave buffers - * (slaves[SLAVES]) to construct request lists to be sent to + * Each of the N slaves should have requests that need to + * be replayed on the next tape. Use the extra slave buffers + * (slaves[SLAVES]) to construct request lists to be sent to * each slave in turn. */ for (i = 0; i < SLAVES; i++) { @@ -401,7 +401,7 @@ rollforward() otb = (union u_spcl *)slp->tblock; /* - * For each request in the current slave, copy it to tslp. + * For each request in the current slave, copy it to tslp. */ prev = NULL; @@ -445,8 +445,8 @@ rollforward() if (prev->dblk != 0) { /* - * If the last one was a disk block, make the - * first of this one be the last bit of that disk + * If the last one was a disk block, make the + * first of this one be the last bit of that disk * block... */ q->dblk = prev->dblk + @@ -454,7 +454,7 @@ rollforward() ntb = (union u_spcl *)tslp->tblock; } else { /* - * It wasn't a disk block. Copy the data to its + * It wasn't a disk block. Copy the data to its * new location in the buffer. */ q->dblk = 0; @@ -548,7 +548,7 @@ restore_check_point: case X_FINOK: msg("Child %d finishes X_FINOK\n", childpid); break; - case X_ABORT: + case X_ABORT: msg("Child %d finishes X_ABORT\n", childpid); break; case X_REWRITE: @@ -598,7 +598,7 @@ restore_check_point: while ((tapefd = (host ? rmtopen(tape, 2) : pipeout ? 1 : open(tape, O_WRONLY|O_CREAT, 0666))) < 0) #else - while ((tapefd = (pipeout ? 1 : + while ((tapefd = (pipeout ? 1 : open(tape, O_WRONLY|O_CREAT, 0666))) < 0) #endif { @@ -613,7 +613,7 @@ restore_check_point: blocksthisvol = 0; if (top) newtape++; /* new tape signal */ - spcl.c_count = slp->count; + spcl.c_count = slp->count; /* * measure firstrec in TP_BSIZE units since restore doesn't * know the correct ntrec value... @@ -707,13 +707,13 @@ enslave() Exit(X_FINOK); } } - + for (i = 0; i < SLAVES; i++) - (void) atomic(write, slaves[i].fd, - (char *) &slaves[(i + 1) % SLAVES].pid, + (void) atomic(write, slaves[i].fd, + (char *) &slaves[(i + 1) % SLAVES].pid, sizeof slaves[0].pid); - - master = 0; + + master = 0; } void @@ -769,7 +769,7 @@ doslave(cmd, slave_number) p->count * TP_BSIZE); } else { if (p->count != 1 || atomic(read, cmd, - (char *)slp->tblock[trecno], + (char *)slp->tblock[trecno], TP_BSIZE) != TP_BSIZE) quit("master/slave protocol botched.\n"); } @@ -798,7 +798,7 @@ doslave(cmd, slave_number) #ifdef WRITEDEBUG printf("slave %d wrote %d\n", slave_number, wrote); #endif - if (wrote < 0) + if (wrote < 0) break; if (wrote == 0) eot_count++; @@ -806,7 +806,7 @@ doslave(cmd, slave_number) } #ifdef WRITEDEBUG - if (size != writesize) + if (size != writesize) printf("slave %d only wrote %d out of %d bytes and gave up.\n", slave_number, size, writesize); #endif @@ -828,7 +828,7 @@ doslave(cmd, slave_number) * (for EOT handling) */ (void) atomic(write, cmd, (char *)&size, sizeof size); - } + } /* * If partial write, don't want next slave to go. diff --git a/sbin/dump/traverse.c b/sbin/dump/traverse.c index ce70050..29034e6 100644 --- a/sbin/dump/traverse.c +++ b/sbin/dump/traverse.c @@ -545,14 +545,14 @@ getino(inum) * Error recovery is attempted at most BREADEMAX times before seeking * consent from the operator to continue. */ -int breaderrors = 0; +int breaderrors = 0; #define BREADEMAX 32 void bread(blkno, buf, size) daddr_t blkno; char *buf; - int size; + int size; { int cnt, i; extern int errno; diff --git a/sbin/dumplfs/dumplfs.c b/sbin/dumplfs/dumplfs.c index 943c6cd..5badb52 100644 --- a/sbin/dumplfs/dumplfs.c +++ b/sbin/dumplfs/dumplfs.c @@ -221,10 +221,10 @@ dump_ifile(fd, lfsp, do_ientries) dump_cleaner_info(lfsp, ipage); print_suheader; continue; - } + } if (i < (lfsp->lfs_segtabsz + lfsp->lfs_cleansz)) { - inum = dump_ipage_segusage(lfsp, inum, ipage, + inum = dump_ipage_segusage(lfsp, inum, ipage, lfsp->lfs_sepb); if (!inum) if(!do_ientries) @@ -251,11 +251,11 @@ dump_ifile(fd, lfsp, do_ientries) if (i < lfsp->lfs_cleansz) { dump_cleaner_info(lfsp, ipage); continue; - } else + } else i -= lfsp->lfs_cleansz; if (i < lfsp->lfs_segtabsz) { - inum = dump_ipage_segusage(lfsp, inum, ipage, + inum = dump_ipage_segusage(lfsp, inum, ipage, lfsp->lfs_sepb); if (!inum) if(!do_ientries) @@ -285,7 +285,7 @@ dump_ifile(fd, lfsp, do_ientries) if (i < lfsp->lfs_cleansz) { dump_cleaner_info(lfsp, ipage); continue; - } else + } else i -= lfsp->lfs_cleansz; if (i < lfsp->lfs_segtabsz) { @@ -385,7 +385,7 @@ dump_sum(fd, lfsp, sp, segnum, addr) int numblocks; struct dinode *inop; - if (sp->ss_sumsum != (ck = cksum(&sp->ss_datasum, + if (sp->ss_sumsum != (ck = cksum(&sp->ss_datasum, LFS_SUMMARY_SIZE - sizeof(sp->ss_sumsum)))) { (void)printf("dumplfs: %s %d address 0x%lx\n", "corrupt summary block; segment", segnum, addr); @@ -410,10 +410,10 @@ dump_sum(fd, lfsp, sp, segnum, addr) printf(" Inode addresses:"); for (dp--, i = 0; i < sp->ss_ninos; dp--) { printf("\t0x%X {", *dp); - get(fd, *dp << (lfsp->lfs_bshift - lfsp->lfs_fsbtodb), inop, + get(fd, *dp << (lfsp->lfs_bshift - lfsp->lfs_fsbtodb), inop, (1 << lfsp->lfs_bshift)); for (j = 0; i < sp->ss_ninos && j < INOPB(lfsp); j++, i++) { - if (j > 0) + if (j > 0) (void)printf(", "); (void)printf("%d", inop[j].di_inumber); } @@ -463,7 +463,7 @@ dump_segment(fd, segnum, addr, lfsp, dump_sb) do { get(fd, sum_offset, sumblock, LFS_SUMMARY_SIZE); sump = (SEGSUM *)sumblock; - if (sump->ss_sumsum != cksum (&sump->ss_datasum, + if (sump->ss_sumsum != cksum (&sump->ss_datasum, LFS_SUMMARY_SIZE - sizeof(sump->ss_sumsum))) { sbp = (struct lfs *)sump; if (sb = (sbp->lfs_magic == LFS_MAGIC)) { @@ -479,7 +479,7 @@ dump_segment(fd, segnum, addr, lfsp, dump_sb) nblocks = dump_sum(fd, lfsp, sump, segnum, sum_offset >> (lfsp->lfs_bshift - lfsp->lfs_fsbtodb)); if (nblocks) - sum_offset += LFS_SUMMARY_SIZE + + sum_offset += LFS_SUMMARY_SIZE + (nblocks << lfsp->lfs_bshift); else sum_offset = 0; diff --git a/sbin/dumpon/dumpon.c b/sbin/dumpon/dumpon.c index 649a73a..dc185e9 100644 --- a/sbin/dumpon/dumpon.c +++ b/sbin/dumpon/dumpon.c @@ -40,7 +40,7 @@ static char copyright[] = #ifndef lint /*static char sccsid[] = "From: @(#)swapon.c 8.1 (Berkeley) 6/5/93";*/ static const char rcsid[] = - "$Id$"; + "$Id: dumpon.c,v 1.1 1995/05/12 19:10:09 wollman Exp $"; #endif /* not lint */ #include <errno.h> @@ -99,7 +99,7 @@ main(int argc, char **argv) mib[0] = CTL_KERN; mib[1] = KERN_DUMPDEV; - rv = sysctl(mib, 2, (void *)0, (size_t *)0, &stab.st_rdev, + rv = sysctl(mib, 2, (void *)0, (size_t *)0, &stab.st_rdev, sizeof stab.st_rdev); if (rv) { err(EX_OSERR, "sysctl: kern.dumpdev"); @@ -110,7 +110,7 @@ main(int argc, char **argv) printf("%s: crash dumps disabled\n", whoami); } else { printf("%s: crash dumps to %s (%lu, %lu)\n", - whoami, argv[0], + whoami, argv[0], (unsigned long)major(stab.st_rdev), (unsigned long)minor(stab.st_rdev)); } diff --git a/sbin/fdisk/Makefile b/sbin/fdisk/Makefile index 78b1c9a..5efa9c5 100644 --- a/sbin/fdisk/Makefile +++ b/sbin/fdisk/Makefile @@ -2,7 +2,7 @@ # # -PROG= fdisk +PROG= fdisk SRCS= fdisk.c MAN8= fdisk.8 diff --git a/sbin/fdisk/fdisk.c b/sbin/fdisk/fdisk.c index b37e6ea..2d0397f 100644 --- a/sbin/fdisk/fdisk.c +++ b/sbin/fdisk/fdisk.c @@ -1,25 +1,25 @@ -/* +/* * Mach Operating System * Copyright (c) 1992 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ @@ -89,37 +89,37 @@ static int i_flag = 0; /* replace partition data */ static int u_flag = 0; /* update partition data */ static unsigned char bootcode[] = { -0x33, 0xc0, 0xfa, 0x8e, 0xd0, 0xbc, 0x00, 0x7c, 0x8e, 0xc0, 0x8e, 0xd8, 0xfb, 0x8b, 0xf4, 0xbf, -0x00, 0x06, 0xb9, 0x00, 0x02, 0xfc, 0xf3, 0xa4, 0xea, 0x1d, 0x06, 0x00, 0x00, 0xb0, 0x04, 0xbe, -0xbe, 0x07, 0x80, 0x3c, 0x80, 0x74, 0x0c, 0x83, 0xc6, 0x10, 0xfe, 0xc8, 0x75, 0xf4, 0xbe, 0xbd, -0x06, 0xeb, 0x43, 0x8b, 0xfe, 0x8b, 0x14, 0x8b, 0x4c, 0x02, 0x83, 0xc6, 0x10, 0xfe, 0xc8, 0x74, -0x0a, 0x80, 0x3c, 0x80, 0x75, 0xf4, 0xbe, 0xbd, 0x06, 0xeb, 0x2b, 0xbd, 0x05, 0x00, 0xbb, 0x00, -0x7c, 0xb8, 0x01, 0x02, 0xcd, 0x13, 0x73, 0x0c, 0x33, 0xc0, 0xcd, 0x13, 0x4d, 0x75, 0xef, 0xbe, -0x9e, 0x06, 0xeb, 0x12, 0x81, 0x3e, 0xfe, 0x7d, 0x55, 0xaa, 0x75, 0x07, 0x8b, 0xf7, 0xea, 0x00, -0x7c, 0x00, 0x00, 0xbe, 0x85, 0x06, 0x2e, 0xac, 0x0a, 0xc0, 0x74, 0x06, 0xb4, 0x0e, 0xcd, 0x10, +0x33, 0xc0, 0xfa, 0x8e, 0xd0, 0xbc, 0x00, 0x7c, 0x8e, 0xc0, 0x8e, 0xd8, 0xfb, 0x8b, 0xf4, 0xbf, +0x00, 0x06, 0xb9, 0x00, 0x02, 0xfc, 0xf3, 0xa4, 0xea, 0x1d, 0x06, 0x00, 0x00, 0xb0, 0x04, 0xbe, +0xbe, 0x07, 0x80, 0x3c, 0x80, 0x74, 0x0c, 0x83, 0xc6, 0x10, 0xfe, 0xc8, 0x75, 0xf4, 0xbe, 0xbd, +0x06, 0xeb, 0x43, 0x8b, 0xfe, 0x8b, 0x14, 0x8b, 0x4c, 0x02, 0x83, 0xc6, 0x10, 0xfe, 0xc8, 0x74, +0x0a, 0x80, 0x3c, 0x80, 0x75, 0xf4, 0xbe, 0xbd, 0x06, 0xeb, 0x2b, 0xbd, 0x05, 0x00, 0xbb, 0x00, +0x7c, 0xb8, 0x01, 0x02, 0xcd, 0x13, 0x73, 0x0c, 0x33, 0xc0, 0xcd, 0x13, 0x4d, 0x75, 0xef, 0xbe, +0x9e, 0x06, 0xeb, 0x12, 0x81, 0x3e, 0xfe, 0x7d, 0x55, 0xaa, 0x75, 0x07, 0x8b, 0xf7, 0xea, 0x00, +0x7c, 0x00, 0x00, 0xbe, 0x85, 0x06, 0x2e, 0xac, 0x0a, 0xc0, 0x74, 0x06, 0xb4, 0x0e, 0xcd, 0x10, 0xeb, 0xf4, 0xfb, 0xeb, 0xfe, 'M', 'i', 's', 's', 'i', 'n', 'g', ' ', 'o', 'p', 'e', 'r', 'a', 't', 'i', 'n', 'g', ' ', 's', 'y', 's', 't', 'e', 'm', 0, -'E', 'r', 'r', 'o', 'r', ' ', 'l', 'o', 'a', 'd', 'i', 'n', 'g', ' ', +'E', 'r', 'r', 'o', 'r', ' ', 'l', 'o', 'a', 'd', 'i', 'n', 'g', ' ', 'o', 'p', 'e', 'r', 'a', 't', 'i', 'n', 'g', ' ', 's', 'y', 's', 't', 'e', 'm', 0, 'I', 'n', 'v', 'a', 'l', 'i', 'd', ' ', 'p', 'a', 'r', 't', 'i', 't', 'i', 'o', 'n', ' ', 't', 'a', 'b', 'l', 'e', 0, 'A', 'u', 't', 'h', 'o', 'r', ' ', '-', ' ', - 'S', 'i', 'e', 'g', 'm', 'a', 'r', ' ', 'S', 'c', 'h', 'm', 'i', 'd', 't', 0,0,0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + 'S', 'i', 'e', 'g', 'm', 'a', 'r', ' ', 'S', 'c', 'h', 'm', 'i', 'd', 't', 0,0,0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; struct part_type @@ -128,46 +128,46 @@ struct part_type char *name; }part_types[] = { - {0x00, "unused"} - ,{0x01, "Primary DOS with 12 bit FAT"} - ,{0x02, "XENIX / filesystem"} - ,{0x03, "XENIX /usr filesystem"} - ,{0x04, "Primary DOS with 16 bit FAT"} - ,{0x05, "Extended DOS"} - ,{0x06, "Primary 'big' DOS (> 32MB)"} - ,{0x07, "OS/2 HPFS, QNX or Advanced UNIX"} - ,{0x08, "AIX filesystem"} - ,{0x09, "AIX boot partition or Coherent"} - ,{0x0A, "OS/2 Boot Manager or OPUS"} - ,{0x10, "OPUS"} - ,{0x40, "VENIX 286"} - ,{0x50, "DM"} - ,{0x51, "DM"} - ,{0x52, "CP/M or Microport SysV/AT"} - ,{0x56, "GB"} - ,{0x61, "Speed"} - ,{0x63, "ISC UNIX, other System V/386, GNU HURD or Mach"} - ,{0x64, "Novell Netware 2.xx"} - ,{0x65, "Novell Netware 3.xx"} - ,{0x75, "PCIX"} - ,{0x80, "Minix 1.1 ... 1.4a"} - ,{0x81, "Minix 1.4b ... 1.5.10"} - ,{0x82, "Linux swap"} - ,{0x83, "Linux filesystem"} - ,{0x93, "Amoeba filesystem"} - ,{0x94, "Amoeba bad block table"} - ,{0xA5, "FreeBSD/NetBSD/386BSD"} + {0x00, "unused"} + ,{0x01, "Primary DOS with 12 bit FAT"} + ,{0x02, "XENIX / filesystem"} + ,{0x03, "XENIX /usr filesystem"} + ,{0x04, "Primary DOS with 16 bit FAT"} + ,{0x05, "Extended DOS"} + ,{0x06, "Primary 'big' DOS (> 32MB)"} + ,{0x07, "OS/2 HPFS, QNX or Advanced UNIX"} + ,{0x08, "AIX filesystem"} + ,{0x09, "AIX boot partition or Coherent"} + ,{0x0A, "OS/2 Boot Manager or OPUS"} + ,{0x10, "OPUS"} + ,{0x40, "VENIX 286"} + ,{0x50, "DM"} + ,{0x51, "DM"} + ,{0x52, "CP/M or Microport SysV/AT"} + ,{0x56, "GB"} + ,{0x61, "Speed"} + ,{0x63, "ISC UNIX, other System V/386, GNU HURD or Mach"} + ,{0x64, "Novell Netware 2.xx"} + ,{0x65, "Novell Netware 3.xx"} + ,{0x75, "PCIX"} + ,{0x80, "Minix 1.1 ... 1.4a"} + ,{0x81, "Minix 1.4b ... 1.5.10"} + ,{0x82, "Linux swap"} + ,{0x83, "Linux filesystem"} + ,{0x93, "Amoeba filesystem"} + ,{0x94, "Amoeba bad block table"} + ,{0xA5, "FreeBSD/NetBSD/386BSD"} ,{0xA7, "NEXTSTEP"} - ,{0xB7, "BSDI BSD/386 filesystem"} - ,{0xB8, "BSDI BSD/386 swap"} - ,{0xDB, "Concurrent CPM or C.DOS or CTOS"} - ,{0xE1, "Speed"} - ,{0xE3, "Speed"} - ,{0xE4, "Speed"} - ,{0xF1, "Speed"} - ,{0xF2, "DOS 3.3+ Secondary"} - ,{0xF4, "Speed"} - ,{0xFF, "BBT (Bad Blocks Table)"} + ,{0xB7, "BSDI BSD/386 filesystem"} + ,{0xB8, "BSDI BSD/386 swap"} + ,{0xDB, "Concurrent CPM or C.DOS or CTOS"} + ,{0xE1, "Speed"} + ,{0xE3, "Speed"} + ,{0xE4, "Speed"} + ,{0xF1, "Speed"} + ,{0xF2, "DOS 3.3+ Secondary"} + ,{0xF4, "Speed"} + ,{0xFF, "BBT (Bad Blocks Table)"} }; @@ -216,7 +216,7 @@ int i; if (argc > 0) disk = argv[0]; - + if (open_disk(u_flag) < 0) exit(1); @@ -302,7 +302,7 @@ struct dos_partition *partp = (struct dos_partition *) (&mboot.parts[3]); int size = disksecs - start; int rest; - memcpy(mboot.bootinst, bootcode, sizeof(bootcode)); + memcpy(mboot.bootinst, bootcode, sizeof(bootcode)); mboot.signature = BOOT_MAGIC; partp->dp_typ = DOSPTYP_386BSD; @@ -366,7 +366,7 @@ struct dos_partition *partp = ((struct dos_partition *) &mboot.parts) + i; dos(partp->dp_start+partp->dp_size - 1, &partp->dp_ecyl, &partp->dp_esect, &partp->dp_ehd); } - + print_part(i); } while (!ok("Are we happy with this entry?")); } @@ -456,7 +456,7 @@ open_disk(u_flag) { struct stat st; - if (stat(disk, &st) == -1) { + if (stat(disk, &st) == -1) { fprintf(stderr, "%s: Can't get file status of %s\n", name, disk); return -1; @@ -516,7 +516,7 @@ get_params(verbose) read_s0() { - if (read_disk(0, (char *) mboot.bootinst) == -1) { + if (read_disk(0, (char *) mboot.bootinst) == -1) { fprintf(stderr, "%s: Can't read fdisk partition table\n", name); return -1; } @@ -545,7 +545,7 @@ write_s0() flag = 1; if (ioctl(fd, DIOCWLABEL, &flag) < 0) perror("ioctl DIOCWLABEL"); - if (write_disk(0, (char *) mboot.bootinst) == -1) { + if (write_disk(0, (char *) mboot.bootinst) == -1) { fprintf(stderr, "%s: Can't write fdisk partition table\n", name); return -1; @@ -687,7 +687,7 @@ int type; int counter = 0; struct part_type *ptr = part_types; - + while(counter < numentries) { if(ptr->type == type) diff --git a/sbin/fsck/dir.c b/sbin/fsck/dir.c index ead9a5f..888bad2 100644 --- a/sbin/fsck/dir.c +++ b/sbin/fsck/dir.c @@ -149,7 +149,7 @@ dirscan(idesc) dirty(bp); sbdirty(); } - if (n & STOP) + if (n & STOP) return (n); } return (idesc->id_filesize > 0 ? KEEPON : STOP); @@ -512,7 +512,7 @@ makeentry(parent, ino, name) struct dinode *dp; struct inodesc idesc; char pathbuf[MAXPATHLEN + 1]; - + if (parent < ROOTINO || parent >= maxino || ino < ROOTINO || ino >= maxino) return (0); diff --git a/sbin/fsck/fsck.h b/sbin/fsck/fsck.h index f38715d..24037b6 100644 --- a/sbin/fsck/fsck.h +++ b/sbin/fsck/fsck.h @@ -112,14 +112,14 @@ struct inodesc { /* * Linked list of duplicate blocks. - * + * * The list is composed of two parts. The first part of the * list (from duplist through the node pointed to by muldup) - * contains a single copy of each duplicate block that has been + * contains a single copy of each duplicate block that has been * found. The second part of the list (from muldup to the end) * contains duplicate blocks that have been found more than once. * To check if a block has been found as a duplicate it is only - * necessary to search from duplist through muldup. To find the + * necessary to search from duplist through muldup. To find the * total number of times that a block has been found as a duplicate * the entire list must be searched for occurences of the block * in question. The following diagram shows a sample list where diff --git a/sbin/fsck/inode.c b/sbin/fsck/inode.c index 22cee3f..aa47fb8 100644 --- a/sbin/fsck/inode.c +++ b/sbin/fsck/inode.c @@ -374,7 +374,7 @@ inocleanup() free((char *)inpsort); inphead = inpsort = NULL; } - + void inodirty() { diff --git a/sbin/fsck/main.c b/sbin/fsck/main.c index 1a6cd44..ddf1892 100644 --- a/sbin/fsck/main.c +++ b/sbin/fsck/main.c @@ -84,7 +84,7 @@ main(argc, argv) case 'c': cvtlevel = argtoi('c', "conversion level", optarg, 10); break; - + case 'd': debug++; break; @@ -296,7 +296,7 @@ checkfilesys(filesys, mntpt, auxdata, child) sbdirty(); } if (cvtlevel && sblk.b_dirty) { - /* + /* * Write out the duplicate super blocks */ for (cylno = 0; cylno < sblock.fs_ncg; cylno++) diff --git a/sbin/fsck/pass1.c b/sbin/fsck/pass1.c index 70ce40a..3fec63a 100644 --- a/sbin/fsck/pass1.c +++ b/sbin/fsck/pass1.c @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 1980, 1986, 1993 * The Regents of the University of California. All rights reserved. * diff --git a/sbin/fsck/pass2.c b/sbin/fsck/pass2.c index 82cbe0a..382207e 100644 --- a/sbin/fsck/pass2.c +++ b/sbin/fsck/pass2.c @@ -211,7 +211,7 @@ pass2check(idesc) dirp->d_type = typemap[dirp->d_ino]; ret |= ALTERED; } - /* + /* * check for "." */ if (idesc->id_entryno != 0) diff --git a/sbin/fsck/pass5.c b/sbin/fsck/pass5.c index 7972468..eae5d7e 100644 --- a/sbin/fsck/pass5.c +++ b/sbin/fsck/pass5.c @@ -117,7 +117,7 @@ pass5() &newcg->cg_space[0] - (u_char *)(&newcg->cg_link); newcg->cg_boff = newcg->cg_btotoff + fs->fs_cpg * sizeof(long); - newcg->cg_iusedoff = newcg->cg_boff + + newcg->cg_iusedoff = newcg->cg_boff + fs->fs_cpg * fs->fs_nrpos * sizeof(short); newcg->cg_freeoff = newcg->cg_iusedoff + howmany(fs->fs_ipg, NBBY); diff --git a/sbin/fsck/preen.c b/sbin/fsck/preen.c index 1cdb01d..413e4d4 100644 --- a/sbin/fsck/preen.c +++ b/sbin/fsck/preen.c @@ -121,7 +121,7 @@ checkfstab(preen, maxrun, docheck, chkit) maxrun = ndisks; nextdisk = disks; for (passno = 0; passno < maxrun; ++passno) { - while ((ret = startdisk(nextdisk, chkit)) != 0 && + while ((ret = startdisk(nextdisk, chkit)) != 0 && nrun > 0) sleep(10); if (ret) diff --git a/sbin/fsck/setup.c b/sbin/fsck/setup.c index fe6f2ea..5fb5697 100644 --- a/sbin/fsck/setup.c +++ b/sbin/fsck/setup.c @@ -157,7 +157,7 @@ setup(dev) sbdirty(); } } - if (sblock.fs_interleave < 1 || + if (sblock.fs_interleave < 1 || sblock.fs_interleave > sblock.fs_nsect) { pwarn("IMPOSSIBLE INTERLEAVE=%d IN SUPERBLOCK", sblock.fs_interleave); @@ -169,7 +169,7 @@ setup(dev) dirty(&asblk); } } - if (sblock.fs_npsect < sblock.fs_nsect || + if (sblock.fs_npsect < sblock.fs_nsect || sblock.fs_npsect > sblock.fs_nsect*2) { pwarn("IMPOSSIBLE NPSECT=%d IN SUPERBLOCK", sblock.fs_npsect); @@ -277,7 +277,7 @@ setup(dev) } lncntp = (short *)calloc((unsigned)(maxino + 1), sizeof(short)); if (lncntp == NULL) { - printf("cannot alloc %u bytes for lncntp\n", + printf("cannot alloc %u bytes for lncntp\n", (unsigned)(maxino + 1) * sizeof(short)); goto badsb; } @@ -289,7 +289,7 @@ setup(dev) inphead = (struct inoinfo **)calloc((unsigned)numdirs, sizeof(struct inoinfo *)); if (inpsort == NULL || inphead == NULL) { - printf("cannot alloc %u bytes for inphead\n", + printf("cannot alloc %u bytes for inphead\n", (unsigned)numdirs * sizeof(struct inoinfo *)); goto badsb; } diff --git a/sbin/fsck_ffs/dir.c b/sbin/fsck_ffs/dir.c index ead9a5f..888bad2 100644 --- a/sbin/fsck_ffs/dir.c +++ b/sbin/fsck_ffs/dir.c @@ -149,7 +149,7 @@ dirscan(idesc) dirty(bp); sbdirty(); } - if (n & STOP) + if (n & STOP) return (n); } return (idesc->id_filesize > 0 ? KEEPON : STOP); @@ -512,7 +512,7 @@ makeentry(parent, ino, name) struct dinode *dp; struct inodesc idesc; char pathbuf[MAXPATHLEN + 1]; - + if (parent < ROOTINO || parent >= maxino || ino < ROOTINO || ino >= maxino) return (0); diff --git a/sbin/fsck_ffs/fsck.h b/sbin/fsck_ffs/fsck.h index f38715d..24037b6 100644 --- a/sbin/fsck_ffs/fsck.h +++ b/sbin/fsck_ffs/fsck.h @@ -112,14 +112,14 @@ struct inodesc { /* * Linked list of duplicate blocks. - * + * * The list is composed of two parts. The first part of the * list (from duplist through the node pointed to by muldup) - * contains a single copy of each duplicate block that has been + * contains a single copy of each duplicate block that has been * found. The second part of the list (from muldup to the end) * contains duplicate blocks that have been found more than once. * To check if a block has been found as a duplicate it is only - * necessary to search from duplist through muldup. To find the + * necessary to search from duplist through muldup. To find the * total number of times that a block has been found as a duplicate * the entire list must be searched for occurences of the block * in question. The following diagram shows a sample list where diff --git a/sbin/fsck_ffs/inode.c b/sbin/fsck_ffs/inode.c index 22cee3f..aa47fb8 100644 --- a/sbin/fsck_ffs/inode.c +++ b/sbin/fsck_ffs/inode.c @@ -374,7 +374,7 @@ inocleanup() free((char *)inpsort); inphead = inpsort = NULL; } - + void inodirty() { diff --git a/sbin/fsck_ffs/main.c b/sbin/fsck_ffs/main.c index 1a6cd44..ddf1892 100644 --- a/sbin/fsck_ffs/main.c +++ b/sbin/fsck_ffs/main.c @@ -84,7 +84,7 @@ main(argc, argv) case 'c': cvtlevel = argtoi('c', "conversion level", optarg, 10); break; - + case 'd': debug++; break; @@ -296,7 +296,7 @@ checkfilesys(filesys, mntpt, auxdata, child) sbdirty(); } if (cvtlevel && sblk.b_dirty) { - /* + /* * Write out the duplicate super blocks */ for (cylno = 0; cylno < sblock.fs_ncg; cylno++) diff --git a/sbin/fsck_ffs/pass1.c b/sbin/fsck_ffs/pass1.c index 70ce40a..3fec63a 100644 --- a/sbin/fsck_ffs/pass1.c +++ b/sbin/fsck_ffs/pass1.c @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 1980, 1986, 1993 * The Regents of the University of California. All rights reserved. * diff --git a/sbin/fsck_ffs/pass2.c b/sbin/fsck_ffs/pass2.c index 82cbe0a..382207e 100644 --- a/sbin/fsck_ffs/pass2.c +++ b/sbin/fsck_ffs/pass2.c @@ -211,7 +211,7 @@ pass2check(idesc) dirp->d_type = typemap[dirp->d_ino]; ret |= ALTERED; } - /* + /* * check for "." */ if (idesc->id_entryno != 0) diff --git a/sbin/fsck_ffs/pass5.c b/sbin/fsck_ffs/pass5.c index 7972468..eae5d7e 100644 --- a/sbin/fsck_ffs/pass5.c +++ b/sbin/fsck_ffs/pass5.c @@ -117,7 +117,7 @@ pass5() &newcg->cg_space[0] - (u_char *)(&newcg->cg_link); newcg->cg_boff = newcg->cg_btotoff + fs->fs_cpg * sizeof(long); - newcg->cg_iusedoff = newcg->cg_boff + + newcg->cg_iusedoff = newcg->cg_boff + fs->fs_cpg * fs->fs_nrpos * sizeof(short); newcg->cg_freeoff = newcg->cg_iusedoff + howmany(fs->fs_ipg, NBBY); diff --git a/sbin/fsck_ffs/preen.c b/sbin/fsck_ffs/preen.c index 1cdb01d..413e4d4 100644 --- a/sbin/fsck_ffs/preen.c +++ b/sbin/fsck_ffs/preen.c @@ -121,7 +121,7 @@ checkfstab(preen, maxrun, docheck, chkit) maxrun = ndisks; nextdisk = disks; for (passno = 0; passno < maxrun; ++passno) { - while ((ret = startdisk(nextdisk, chkit)) != 0 && + while ((ret = startdisk(nextdisk, chkit)) != 0 && nrun > 0) sleep(10); if (ret) diff --git a/sbin/fsck_ffs/setup.c b/sbin/fsck_ffs/setup.c index fe6f2ea..5fb5697 100644 --- a/sbin/fsck_ffs/setup.c +++ b/sbin/fsck_ffs/setup.c @@ -157,7 +157,7 @@ setup(dev) sbdirty(); } } - if (sblock.fs_interleave < 1 || + if (sblock.fs_interleave < 1 || sblock.fs_interleave > sblock.fs_nsect) { pwarn("IMPOSSIBLE INTERLEAVE=%d IN SUPERBLOCK", sblock.fs_interleave); @@ -169,7 +169,7 @@ setup(dev) dirty(&asblk); } } - if (sblock.fs_npsect < sblock.fs_nsect || + if (sblock.fs_npsect < sblock.fs_nsect || sblock.fs_npsect > sblock.fs_nsect*2) { pwarn("IMPOSSIBLE NPSECT=%d IN SUPERBLOCK", sblock.fs_npsect); @@ -277,7 +277,7 @@ setup(dev) } lncntp = (short *)calloc((unsigned)(maxino + 1), sizeof(short)); if (lncntp == NULL) { - printf("cannot alloc %u bytes for lncntp\n", + printf("cannot alloc %u bytes for lncntp\n", (unsigned)(maxino + 1) * sizeof(short)); goto badsb; } @@ -289,7 +289,7 @@ setup(dev) inphead = (struct inoinfo **)calloc((unsigned)numdirs, sizeof(struct inoinfo *)); if (inpsort == NULL || inphead == NULL) { - printf("cannot alloc %u bytes for inphead\n", + printf("cannot alloc %u bytes for inphead\n", (unsigned)numdirs * sizeof(struct inoinfo *)); goto badsb; } diff --git a/sbin/fsck_ifs/dir.c b/sbin/fsck_ifs/dir.c index ead9a5f..888bad2 100644 --- a/sbin/fsck_ifs/dir.c +++ b/sbin/fsck_ifs/dir.c @@ -149,7 +149,7 @@ dirscan(idesc) dirty(bp); sbdirty(); } - if (n & STOP) + if (n & STOP) return (n); } return (idesc->id_filesize > 0 ? KEEPON : STOP); @@ -512,7 +512,7 @@ makeentry(parent, ino, name) struct dinode *dp; struct inodesc idesc; char pathbuf[MAXPATHLEN + 1]; - + if (parent < ROOTINO || parent >= maxino || ino < ROOTINO || ino >= maxino) return (0); diff --git a/sbin/fsck_ifs/fsck.h b/sbin/fsck_ifs/fsck.h index f38715d..24037b6 100644 --- a/sbin/fsck_ifs/fsck.h +++ b/sbin/fsck_ifs/fsck.h @@ -112,14 +112,14 @@ struct inodesc { /* * Linked list of duplicate blocks. - * + * * The list is composed of two parts. The first part of the * list (from duplist through the node pointed to by muldup) - * contains a single copy of each duplicate block that has been + * contains a single copy of each duplicate block that has been * found. The second part of the list (from muldup to the end) * contains duplicate blocks that have been found more than once. * To check if a block has been found as a duplicate it is only - * necessary to search from duplist through muldup. To find the + * necessary to search from duplist through muldup. To find the * total number of times that a block has been found as a duplicate * the entire list must be searched for occurences of the block * in question. The following diagram shows a sample list where diff --git a/sbin/fsck_ifs/inode.c b/sbin/fsck_ifs/inode.c index 22cee3f..aa47fb8 100644 --- a/sbin/fsck_ifs/inode.c +++ b/sbin/fsck_ifs/inode.c @@ -374,7 +374,7 @@ inocleanup() free((char *)inpsort); inphead = inpsort = NULL; } - + void inodirty() { diff --git a/sbin/fsck_ifs/main.c b/sbin/fsck_ifs/main.c index 1a6cd44..ddf1892 100644 --- a/sbin/fsck_ifs/main.c +++ b/sbin/fsck_ifs/main.c @@ -84,7 +84,7 @@ main(argc, argv) case 'c': cvtlevel = argtoi('c', "conversion level", optarg, 10); break; - + case 'd': debug++; break; @@ -296,7 +296,7 @@ checkfilesys(filesys, mntpt, auxdata, child) sbdirty(); } if (cvtlevel && sblk.b_dirty) { - /* + /* * Write out the duplicate super blocks */ for (cylno = 0; cylno < sblock.fs_ncg; cylno++) diff --git a/sbin/fsck_ifs/pass1.c b/sbin/fsck_ifs/pass1.c index 70ce40a..3fec63a 100644 --- a/sbin/fsck_ifs/pass1.c +++ b/sbin/fsck_ifs/pass1.c @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 1980, 1986, 1993 * The Regents of the University of California. All rights reserved. * diff --git a/sbin/fsck_ifs/pass2.c b/sbin/fsck_ifs/pass2.c index 82cbe0a..382207e 100644 --- a/sbin/fsck_ifs/pass2.c +++ b/sbin/fsck_ifs/pass2.c @@ -211,7 +211,7 @@ pass2check(idesc) dirp->d_type = typemap[dirp->d_ino]; ret |= ALTERED; } - /* + /* * check for "." */ if (idesc->id_entryno != 0) diff --git a/sbin/fsck_ifs/pass5.c b/sbin/fsck_ifs/pass5.c index 7972468..eae5d7e 100644 --- a/sbin/fsck_ifs/pass5.c +++ b/sbin/fsck_ifs/pass5.c @@ -117,7 +117,7 @@ pass5() &newcg->cg_space[0] - (u_char *)(&newcg->cg_link); newcg->cg_boff = newcg->cg_btotoff + fs->fs_cpg * sizeof(long); - newcg->cg_iusedoff = newcg->cg_boff + + newcg->cg_iusedoff = newcg->cg_boff + fs->fs_cpg * fs->fs_nrpos * sizeof(short); newcg->cg_freeoff = newcg->cg_iusedoff + howmany(fs->fs_ipg, NBBY); diff --git a/sbin/fsck_ifs/preen.c b/sbin/fsck_ifs/preen.c index 1cdb01d..413e4d4 100644 --- a/sbin/fsck_ifs/preen.c +++ b/sbin/fsck_ifs/preen.c @@ -121,7 +121,7 @@ checkfstab(preen, maxrun, docheck, chkit) maxrun = ndisks; nextdisk = disks; for (passno = 0; passno < maxrun; ++passno) { - while ((ret = startdisk(nextdisk, chkit)) != 0 && + while ((ret = startdisk(nextdisk, chkit)) != 0 && nrun > 0) sleep(10); if (ret) diff --git a/sbin/fsck_ifs/setup.c b/sbin/fsck_ifs/setup.c index fe6f2ea..5fb5697 100644 --- a/sbin/fsck_ifs/setup.c +++ b/sbin/fsck_ifs/setup.c @@ -157,7 +157,7 @@ setup(dev) sbdirty(); } } - if (sblock.fs_interleave < 1 || + if (sblock.fs_interleave < 1 || sblock.fs_interleave > sblock.fs_nsect) { pwarn("IMPOSSIBLE INTERLEAVE=%d IN SUPERBLOCK", sblock.fs_interleave); @@ -169,7 +169,7 @@ setup(dev) dirty(&asblk); } } - if (sblock.fs_npsect < sblock.fs_nsect || + if (sblock.fs_npsect < sblock.fs_nsect || sblock.fs_npsect > sblock.fs_nsect*2) { pwarn("IMPOSSIBLE NPSECT=%d IN SUPERBLOCK", sblock.fs_npsect); @@ -277,7 +277,7 @@ setup(dev) } lncntp = (short *)calloc((unsigned)(maxino + 1), sizeof(short)); if (lncntp == NULL) { - printf("cannot alloc %u bytes for lncntp\n", + printf("cannot alloc %u bytes for lncntp\n", (unsigned)(maxino + 1) * sizeof(short)); goto badsb; } @@ -289,7 +289,7 @@ setup(dev) inphead = (struct inoinfo **)calloc((unsigned)numdirs, sizeof(struct inoinfo *)); if (inpsort == NULL || inphead == NULL) { - printf("cannot alloc %u bytes for inphead\n", + printf("cannot alloc %u bytes for inphead\n", (unsigned)numdirs * sizeof(struct inoinfo *)); goto badsb; } diff --git a/sbin/i386/fdisk/Makefile b/sbin/i386/fdisk/Makefile index 78b1c9a..5efa9c5 100644 --- a/sbin/i386/fdisk/Makefile +++ b/sbin/i386/fdisk/Makefile @@ -2,7 +2,7 @@ # # -PROG= fdisk +PROG= fdisk SRCS= fdisk.c MAN8= fdisk.8 diff --git a/sbin/i386/fdisk/fdisk.c b/sbin/i386/fdisk/fdisk.c index b37e6ea..2d0397f 100644 --- a/sbin/i386/fdisk/fdisk.c +++ b/sbin/i386/fdisk/fdisk.c @@ -1,25 +1,25 @@ -/* +/* * Mach Operating System * Copyright (c) 1992 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ @@ -89,37 +89,37 @@ static int i_flag = 0; /* replace partition data */ static int u_flag = 0; /* update partition data */ static unsigned char bootcode[] = { -0x33, 0xc0, 0xfa, 0x8e, 0xd0, 0xbc, 0x00, 0x7c, 0x8e, 0xc0, 0x8e, 0xd8, 0xfb, 0x8b, 0xf4, 0xbf, -0x00, 0x06, 0xb9, 0x00, 0x02, 0xfc, 0xf3, 0xa4, 0xea, 0x1d, 0x06, 0x00, 0x00, 0xb0, 0x04, 0xbe, -0xbe, 0x07, 0x80, 0x3c, 0x80, 0x74, 0x0c, 0x83, 0xc6, 0x10, 0xfe, 0xc8, 0x75, 0xf4, 0xbe, 0xbd, -0x06, 0xeb, 0x43, 0x8b, 0xfe, 0x8b, 0x14, 0x8b, 0x4c, 0x02, 0x83, 0xc6, 0x10, 0xfe, 0xc8, 0x74, -0x0a, 0x80, 0x3c, 0x80, 0x75, 0xf4, 0xbe, 0xbd, 0x06, 0xeb, 0x2b, 0xbd, 0x05, 0x00, 0xbb, 0x00, -0x7c, 0xb8, 0x01, 0x02, 0xcd, 0x13, 0x73, 0x0c, 0x33, 0xc0, 0xcd, 0x13, 0x4d, 0x75, 0xef, 0xbe, -0x9e, 0x06, 0xeb, 0x12, 0x81, 0x3e, 0xfe, 0x7d, 0x55, 0xaa, 0x75, 0x07, 0x8b, 0xf7, 0xea, 0x00, -0x7c, 0x00, 0x00, 0xbe, 0x85, 0x06, 0x2e, 0xac, 0x0a, 0xc0, 0x74, 0x06, 0xb4, 0x0e, 0xcd, 0x10, +0x33, 0xc0, 0xfa, 0x8e, 0xd0, 0xbc, 0x00, 0x7c, 0x8e, 0xc0, 0x8e, 0xd8, 0xfb, 0x8b, 0xf4, 0xbf, +0x00, 0x06, 0xb9, 0x00, 0x02, 0xfc, 0xf3, 0xa4, 0xea, 0x1d, 0x06, 0x00, 0x00, 0xb0, 0x04, 0xbe, +0xbe, 0x07, 0x80, 0x3c, 0x80, 0x74, 0x0c, 0x83, 0xc6, 0x10, 0xfe, 0xc8, 0x75, 0xf4, 0xbe, 0xbd, +0x06, 0xeb, 0x43, 0x8b, 0xfe, 0x8b, 0x14, 0x8b, 0x4c, 0x02, 0x83, 0xc6, 0x10, 0xfe, 0xc8, 0x74, +0x0a, 0x80, 0x3c, 0x80, 0x75, 0xf4, 0xbe, 0xbd, 0x06, 0xeb, 0x2b, 0xbd, 0x05, 0x00, 0xbb, 0x00, +0x7c, 0xb8, 0x01, 0x02, 0xcd, 0x13, 0x73, 0x0c, 0x33, 0xc0, 0xcd, 0x13, 0x4d, 0x75, 0xef, 0xbe, +0x9e, 0x06, 0xeb, 0x12, 0x81, 0x3e, 0xfe, 0x7d, 0x55, 0xaa, 0x75, 0x07, 0x8b, 0xf7, 0xea, 0x00, +0x7c, 0x00, 0x00, 0xbe, 0x85, 0x06, 0x2e, 0xac, 0x0a, 0xc0, 0x74, 0x06, 0xb4, 0x0e, 0xcd, 0x10, 0xeb, 0xf4, 0xfb, 0xeb, 0xfe, 'M', 'i', 's', 's', 'i', 'n', 'g', ' ', 'o', 'p', 'e', 'r', 'a', 't', 'i', 'n', 'g', ' ', 's', 'y', 's', 't', 'e', 'm', 0, -'E', 'r', 'r', 'o', 'r', ' ', 'l', 'o', 'a', 'd', 'i', 'n', 'g', ' ', +'E', 'r', 'r', 'o', 'r', ' ', 'l', 'o', 'a', 'd', 'i', 'n', 'g', ' ', 'o', 'p', 'e', 'r', 'a', 't', 'i', 'n', 'g', ' ', 's', 'y', 's', 't', 'e', 'm', 0, 'I', 'n', 'v', 'a', 'l', 'i', 'd', ' ', 'p', 'a', 'r', 't', 'i', 't', 'i', 'o', 'n', ' ', 't', 'a', 'b', 'l', 'e', 0, 'A', 'u', 't', 'h', 'o', 'r', ' ', '-', ' ', - 'S', 'i', 'e', 'g', 'm', 'a', 'r', ' ', 'S', 'c', 'h', 'm', 'i', 'd', 't', 0,0,0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + 'S', 'i', 'e', 'g', 'm', 'a', 'r', ' ', 'S', 'c', 'h', 'm', 'i', 'd', 't', 0,0,0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; struct part_type @@ -128,46 +128,46 @@ struct part_type char *name; }part_types[] = { - {0x00, "unused"} - ,{0x01, "Primary DOS with 12 bit FAT"} - ,{0x02, "XENIX / filesystem"} - ,{0x03, "XENIX /usr filesystem"} - ,{0x04, "Primary DOS with 16 bit FAT"} - ,{0x05, "Extended DOS"} - ,{0x06, "Primary 'big' DOS (> 32MB)"} - ,{0x07, "OS/2 HPFS, QNX or Advanced UNIX"} - ,{0x08, "AIX filesystem"} - ,{0x09, "AIX boot partition or Coherent"} - ,{0x0A, "OS/2 Boot Manager or OPUS"} - ,{0x10, "OPUS"} - ,{0x40, "VENIX 286"} - ,{0x50, "DM"} - ,{0x51, "DM"} - ,{0x52, "CP/M or Microport SysV/AT"} - ,{0x56, "GB"} - ,{0x61, "Speed"} - ,{0x63, "ISC UNIX, other System V/386, GNU HURD or Mach"} - ,{0x64, "Novell Netware 2.xx"} - ,{0x65, "Novell Netware 3.xx"} - ,{0x75, "PCIX"} - ,{0x80, "Minix 1.1 ... 1.4a"} - ,{0x81, "Minix 1.4b ... 1.5.10"} - ,{0x82, "Linux swap"} - ,{0x83, "Linux filesystem"} - ,{0x93, "Amoeba filesystem"} - ,{0x94, "Amoeba bad block table"} - ,{0xA5, "FreeBSD/NetBSD/386BSD"} + {0x00, "unused"} + ,{0x01, "Primary DOS with 12 bit FAT"} + ,{0x02, "XENIX / filesystem"} + ,{0x03, "XENIX /usr filesystem"} + ,{0x04, "Primary DOS with 16 bit FAT"} + ,{0x05, "Extended DOS"} + ,{0x06, "Primary 'big' DOS (> 32MB)"} + ,{0x07, "OS/2 HPFS, QNX or Advanced UNIX"} + ,{0x08, "AIX filesystem"} + ,{0x09, "AIX boot partition or Coherent"} + ,{0x0A, "OS/2 Boot Manager or OPUS"} + ,{0x10, "OPUS"} + ,{0x40, "VENIX 286"} + ,{0x50, "DM"} + ,{0x51, "DM"} + ,{0x52, "CP/M or Microport SysV/AT"} + ,{0x56, "GB"} + ,{0x61, "Speed"} + ,{0x63, "ISC UNIX, other System V/386, GNU HURD or Mach"} + ,{0x64, "Novell Netware 2.xx"} + ,{0x65, "Novell Netware 3.xx"} + ,{0x75, "PCIX"} + ,{0x80, "Minix 1.1 ... 1.4a"} + ,{0x81, "Minix 1.4b ... 1.5.10"} + ,{0x82, "Linux swap"} + ,{0x83, "Linux filesystem"} + ,{0x93, "Amoeba filesystem"} + ,{0x94, "Amoeba bad block table"} + ,{0xA5, "FreeBSD/NetBSD/386BSD"} ,{0xA7, "NEXTSTEP"} - ,{0xB7, "BSDI BSD/386 filesystem"} - ,{0xB8, "BSDI BSD/386 swap"} - ,{0xDB, "Concurrent CPM or C.DOS or CTOS"} - ,{0xE1, "Speed"} - ,{0xE3, "Speed"} - ,{0xE4, "Speed"} - ,{0xF1, "Speed"} - ,{0xF2, "DOS 3.3+ Secondary"} - ,{0xF4, "Speed"} - ,{0xFF, "BBT (Bad Blocks Table)"} + ,{0xB7, "BSDI BSD/386 filesystem"} + ,{0xB8, "BSDI BSD/386 swap"} + ,{0xDB, "Concurrent CPM or C.DOS or CTOS"} + ,{0xE1, "Speed"} + ,{0xE3, "Speed"} + ,{0xE4, "Speed"} + ,{0xF1, "Speed"} + ,{0xF2, "DOS 3.3+ Secondary"} + ,{0xF4, "Speed"} + ,{0xFF, "BBT (Bad Blocks Table)"} }; @@ -216,7 +216,7 @@ int i; if (argc > 0) disk = argv[0]; - + if (open_disk(u_flag) < 0) exit(1); @@ -302,7 +302,7 @@ struct dos_partition *partp = (struct dos_partition *) (&mboot.parts[3]); int size = disksecs - start; int rest; - memcpy(mboot.bootinst, bootcode, sizeof(bootcode)); + memcpy(mboot.bootinst, bootcode, sizeof(bootcode)); mboot.signature = BOOT_MAGIC; partp->dp_typ = DOSPTYP_386BSD; @@ -366,7 +366,7 @@ struct dos_partition *partp = ((struct dos_partition *) &mboot.parts) + i; dos(partp->dp_start+partp->dp_size - 1, &partp->dp_ecyl, &partp->dp_esect, &partp->dp_ehd); } - + print_part(i); } while (!ok("Are we happy with this entry?")); } @@ -456,7 +456,7 @@ open_disk(u_flag) { struct stat st; - if (stat(disk, &st) == -1) { + if (stat(disk, &st) == -1) { fprintf(stderr, "%s: Can't get file status of %s\n", name, disk); return -1; @@ -516,7 +516,7 @@ get_params(verbose) read_s0() { - if (read_disk(0, (char *) mboot.bootinst) == -1) { + if (read_disk(0, (char *) mboot.bootinst) == -1) { fprintf(stderr, "%s: Can't read fdisk partition table\n", name); return -1; } @@ -545,7 +545,7 @@ write_s0() flag = 1; if (ioctl(fd, DIOCWLABEL, &flag) < 0) perror("ioctl DIOCWLABEL"); - if (write_disk(0, (char *) mboot.bootinst) == -1) { + if (write_disk(0, (char *) mboot.bootinst) == -1) { fprintf(stderr, "%s: Can't write fdisk partition table\n", name); return -1; @@ -687,7 +687,7 @@ int type; int counter = 0; struct part_type *ptr = part_types; - + while(counter < numentries) { if(ptr->type == type) diff --git a/sbin/i386/ft/ft.c b/sbin/i386/ft/ft.c index 49aadd3..b1dbbb2 100644 --- a/sbin/i386/ft/ft.c +++ b/sbin/i386/ft/ft.c @@ -105,7 +105,7 @@ check_stat(int fd, int wr) return(1); } } - + if ((s & QS_FMTOK) == 0) { fprintf(stderr, "tape is not formatted\n"); return(2); diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 675cf66..cc37eb8 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -68,8 +68,8 @@ static char sccsid[] = "@(#)ifconfig.c 8.2 (Berkeley) 2/16/94"; #include <stdlib.h> #include <string.h> #include <unistd.h> -#include <nlist.h> -#include <kvm.h> +#include <nlist.h> +#include <kvm.h> #include <fcntl.h> struct ifreq ifr, ridreq; @@ -287,7 +287,7 @@ ifconfig(argc,argv,af,rafp,flag) perror("ioctl (SIOCGIFMTU)"); else mtu = ifr.ifr_mtu; - if (argc == 0) { + if (argc == 0) { status(); return(0); } @@ -701,7 +701,7 @@ ether_status() m += printf("%02x%c", *cp++ & 0xff, n > 0 ? ':' : ' '); - putchar('\n'); + putchar('\n'); } break; } @@ -710,7 +710,7 @@ ether_status() } kvm_close(kvmd); } - + Perror(cmd) char *cmd; { diff --git a/sbin/init/init.c b/sbin/init/init.c index 4ac9c97..e7b6fa6 100644 --- a/sbin/init/init.c +++ b/sbin/init/init.c @@ -678,14 +678,14 @@ single_user() return (state_func_t) requested_transition; if (!WIFEXITED(status)) { - if (WTERMSIG(status) == SIGKILL) { - /* - * reboot(8) killed shell? + if (WTERMSIG(status) == SIGKILL) { + /* + * reboot(8) killed shell? */ warning("single user shell terminated."); sleep(STALL_TIMEOUT); _exit(0); - } else { + } else { warning("single user shell terminated, restarting"); return (state_func_t) single_user; } @@ -797,7 +797,7 @@ start_session_db() return (1); } return (0); - + } /* @@ -1215,7 +1215,7 @@ multi_user() /* * If the administrator has not set the security level to -1 * to indicate that the kernel should not run multiuser in secure - * mode, and the run script has not set a higher level of security + * mode, and the run script has not set a higher level of security * than level 1, then put the kernel into secure mode. */ if (getsecuritylevel() == 0) @@ -1391,7 +1391,7 @@ strk (char *p) return 0; c = *t; - while (c == ' ' || c == '\t' ) + while (c == ' ' || c == '\t' ) c = *++t; if (!c) { t = 0; @@ -1401,7 +1401,7 @@ strk (char *p) if (c == '\'') { c = *++t; q = t; - while (c && c != '\'') + while (c && c != '\'') c = *++t; if (!c) /* unterminated string */ q = t = 0; @@ -1411,7 +1411,7 @@ strk (char *p) while (c && c != ' ' && c != '\t' ) c = *++t; *t++ = 0; - if (!c) + if (!c) t = 0; } return q; diff --git a/sbin/ipfw/ipfw.c b/sbin/ipfw/ipfw.c index 4bde700..b19989a 100644 --- a/sbin/ipfw/ipfw.c +++ b/sbin/ipfw/ipfw.c @@ -77,11 +77,11 @@ char action_tab[][MAXSTR]={ "f", #define A_FLUSH 6 "z", -#define A_ZERO 7 +#define A_ZERO 7 "l", -#define A_LIST 8 +#define A_LIST 8 "po", -#define A_POLICY 9 +#define A_POLICY 9 "", #define A_NONE 10 }; @@ -158,7 +158,7 @@ u_long mask; return -1; } mask=mask>>1; - } + } return h_num; } @@ -178,16 +178,16 @@ int i,mb; if (do_short && do_acct) { printf("%8d:%8d ",chain->fw_bcnt,chain->fw_pcnt); } - + if (do_short) if (c_t==FW) { - if (chain->fw_flg & IP_FW_F_ACCEPT) + if (chain->fw_flg & IP_FW_F_ACCEPT) if (chain->fw_flg & IP_FW_F_PRN) printf("l"); else printf("a"); - else + else if (chain->fw_flg & IP_FW_F_PRN) if (chain->fw_flg & IP_FW_F_ICMPRPL) printf("R"); @@ -199,19 +199,19 @@ if (do_short) else printf("d"); } else { - if (chain->fw_flg & IP_FW_F_BIDIR) + if (chain->fw_flg & IP_FW_F_BIDIR) printf("b"); - else + else printf("s"); } else if (c_t==FW) { - if (chain->fw_flg & IP_FW_F_ACCEPT) + if (chain->fw_flg & IP_FW_F_ACCEPT) if (chain->fw_flg & IP_FW_F_PRN) printf("log "); else printf("accept "); - else + else if (chain->fw_flg & IP_FW_F_PRN) if (chain->fw_flg & IP_FW_F_ICMPRPL) printf("lreject "); @@ -223,9 +223,9 @@ else else printf("deny "); } else { - if (chain->fw_flg & IP_FW_F_BIDIR) + if (chain->fw_flg & IP_FW_F_BIDIR) printf("bidir "); - else + else printf("single "); } @@ -299,9 +299,9 @@ else comma = " "; for (i=0;i<chain->fw_nsp; i++ ) { printf("%s%d",comma,chain->fw_pts[i]); - if (i==0 && (chain->fw_flg & IP_FW_F_SRNG)) + if (i==0 && (chain->fw_flg & IP_FW_F_SRNG)) comma = ":"; - else + else comma = ","; } @@ -322,7 +322,7 @@ else printf("%s",he->h_name); } else { printf(inet_ntoa(chain->fw_dst)); - if (adrt!=ULONG_MAX) + if (adrt!=ULONG_MAX) if ((mb=mask_bits(chain->fw_dmsk))>=0) printf("/%d",mb); else { @@ -336,7 +336,7 @@ else printf("%s%d",comma,chain->fw_pts[chain->fw_nsp+i]); if (i==chain->fw_nsp && (chain->fw_flg & IP_FW_F_DRNG)) comma = ":"; - else + else comma = ","; } @@ -501,7 +501,7 @@ int a_max; int *is_range; { char *s_pr2,*s_h,*s_t,*cp; -u_short p1,p2; +u_short p1,p2; int i=0; (void)strtok(str,":"); @@ -556,7 +556,7 @@ struct hostent *hptr; mask->s_addr=0L; return; } - + if (mask) { (void)strtok(str,"/"); @@ -564,7 +564,7 @@ struct hostent *hptr; (void)strtok(str,":"); sm_oct=strtok(NULL,""); } - + if (!inet_aton(str,addr)) { if (do_resolv) { if (!(hptr=gethostbyname(str))) { @@ -581,7 +581,7 @@ struct hostent *hptr; } /* - * This is in case mask we + * This is in case mask we * want to set IP only */ if (!mask) @@ -603,7 +603,7 @@ struct hostent *hptr; htonl(ULONG_MAX<<(sizeof(u_long)*CHAR_BIT-n_bit)); else mask->s_addr=0L; - } + } if (sm_oct) { if (!inet_aton(sm_oct,mask)) { @@ -620,14 +620,14 @@ struct hostent *hptr; } -int set_entry_ifname(str,frwl) +int set_entry_ifname(str,frwl) char *str; struct ip_fw * frwl; { char name[IFNAMSIZ],buf[IFNAMSIZ],*sptr; short unit; int i; - + i=0; sptr=str; while(isalpha(*sptr++)) { i++; @@ -654,7 +654,7 @@ int i; } -void set_entry(av,frwl) +void set_entry(av,frwl) char **av; struct ip_fw * frwl; { @@ -711,7 +711,7 @@ get_next: show_usage("Missing 'to' specification."); exit(1); } - + set_entry_ip(*av,&(frwl->fw_dst),&(frwl->fw_dmsk)); got_to = 1; } @@ -729,7 +729,7 @@ get_next: } /* - * Try first to set interface name + * Try first to set interface name * from arguments.set_entry_ip() will exit on * wrong argument. */ @@ -838,7 +838,7 @@ if (*av==NULL || strlen(*av)<=0) { } if (kvm_nlist(kd,nlf) < 0 || nlf[0].n_type == 0) { fprintf(stderr,"%s: kvm_nlist: no namelist in %s\n", - progname,getbootfile()); + progname,getbootfile()); exit(1); } @@ -900,7 +900,7 @@ struct ip_fw frwl; s = socket( AF_INET, SOCK_RAW, IPPROTO_RAW ); if ( s < 0 ) { - fprintf(stderr,"%s: Can't open raw socket.Must be root to use this programm. \n",progname); + fprintf(stderr,"%s: Can't open raw socket.Must be root to use this programm. \n",progname); exit(1); } if ( ac == 1 ) { @@ -922,7 +922,7 @@ struct ip_fw frwl; case '?': default: show_usage(NULL); - exit(1); + exit(1); } if (*(av+=optind)==NULL) { @@ -956,13 +956,13 @@ struct ip_fw frwl; int_t=AC; break; case A_FLUSH: - flush(++av); + flush(++av); exit(0); /* successful exit */ case A_LIST: - list(++av); + list(++av); exit(0); /* successful exit */ case A_ZERO: - zero(); + zero(); exit(0); /* successful exit */ case A_POLICY: policy(++av); @@ -974,7 +974,7 @@ struct ip_fw frwl; if (is_check) goto proto_switch; - + if (!int_notdef) if (*(++av)==NULL) { show_usage(NULL); @@ -1078,14 +1078,14 @@ proto_switch: exit(1); } - set_entry(av,&frwl); + set_entry(av,&frwl); frwl.fw_flg=flags; if (is_check) { #ifndef disabled fprintf(stderr,"%s: checking disabled.\n",progname); #else - + struct ip *pkt; struct tcphdr *th; int p_len=sizeof(struct ip)+sizeof(struct tcphdr); @@ -1120,10 +1120,10 @@ proto_switch: } pkt->ip_src.s_addr=frwl.fw_src.s_addr; pkt->ip_dst.s_addr=frwl.fw_dst.s_addr; - + th->th_sport=htons(frwl.fw_pts[0]); th->th_dport=htons(frwl.fw_pts[frwl.fw_nsp]); - + if (setsockopt(s,IPPROTO_IP,ctl,pkt,p_len)) printf("Packet DENYED.\n"); else diff --git a/sbin/md5/md5.c b/sbin/md5/md5.c index 5a697f8..d3a0281 100644 --- a/sbin/md5/md5.c +++ b/sbin/md5/md5.c @@ -1,5 +1,5 @@ /* - * $Id: md5.c,v 1.3 1995/02/26 01:55:31 phk Exp $ + * $Id: md5.c,v 1.4 1995/02/26 02:00:35 phk Exp $ * * Derived from: */ @@ -67,7 +67,7 @@ main(argc, argv) MDTestSuite(); else { p = MD5File(argv[i]); - if (!p) + if (!p) perror(argv[i]); else printf("MD5 (%s) = %s\n", argv[i], p); diff --git a/sbin/modload/modload.c b/sbin/modload/modload.c index 4787f11..0efd0ea 100644 --- a/sbin/modload/modload.c +++ b/sbin/modload/modload.c @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: modload.c,v 1.6 1995/01/23 04:07:57 wollman Exp $ + * $Id: modload.c,v 1.7 1995/03/16 17:11:21 wollman Exp $ */ #include <stdio.h> @@ -106,7 +106,7 @@ linkcmd(kernel, entry, outfile, address, object) waitpid(pid, &status, 0); if(WIFSIGNALED(status)) { - errx(1, "%s got signal: %s", _PATH_LD, + errx(1, "%s got signal: %s", _PATH_LD, sys_siglist[WTERMSIG(status)]); } diff --git a/sbin/mount/mount_ufs.c b/sbin/mount/mount_ufs.c index 500a977..fac1417 100644 --- a/sbin/mount/mount_ufs.c +++ b/sbin/mount/mount_ufs.c @@ -117,7 +117,7 @@ mount_ufs(argc, argv) /*warnx("ufs: filesystem not found");*/ } } - + if (mount(vfc ? vfc->vfc_index : MOUNT_UFS, fs_name, mntflags, &args) < 0) { (void)fprintf(stderr, "%s on %s: ", args.fspec, fs_name); switch (errno) { @@ -128,7 +128,7 @@ mount_ufs(argc, argv) if (mntflags & MNT_UPDATE) (void)fprintf(stderr, "Specified device does not match mounted device.\n"); - else + else (void)fprintf(stderr, "Incorrect super block.\n"); break; diff --git a/sbin/mount_ifs/mount_ufs.c b/sbin/mount_ifs/mount_ufs.c index 500a977..fac1417 100644 --- a/sbin/mount_ifs/mount_ufs.c +++ b/sbin/mount_ifs/mount_ufs.c @@ -117,7 +117,7 @@ mount_ufs(argc, argv) /*warnx("ufs: filesystem not found");*/ } } - + if (mount(vfc ? vfc->vfc_index : MOUNT_UFS, fs_name, mntflags, &args) < 0) { (void)fprintf(stderr, "%s on %s: ", args.fspec, fs_name); switch (errno) { @@ -128,7 +128,7 @@ mount_ufs(argc, argv) if (mntflags & MNT_UPDATE) (void)fprintf(stderr, "Specified device does not match mounted device.\n"); - else + else (void)fprintf(stderr, "Incorrect super block.\n"); break; diff --git a/sbin/mount_portal/conf.c b/sbin/mount_portal/conf.c index 5b335a8..3eb4af3 100644 --- a/sbin/mount_portal/conf.c +++ b/sbin/mount_portal/conf.c @@ -36,7 +36,7 @@ * * @(#)conf.c 8.2 (Berkeley) 3/27/94 * - * $Id: conf.c,v 1.2 1992/05/27 07:09:27 jsp Exp jsp $ + * $Id: conf.c,v 1.2 1995/02/21 04:05:20 wollman Exp $ */ #include <stdio.h> @@ -131,7 +131,7 @@ qelem *q0; } ins_que(&p0->p_q, q0->q_back); return (1); - + } static path *palloc(cline, lno) diff --git a/sbin/mount_portal/mount_portal.c b/sbin/mount_portal/mount_portal.c index 23098d2..51184df 100644 --- a/sbin/mount_portal/mount_portal.c +++ b/sbin/mount_portal/mount_portal.c @@ -220,7 +220,7 @@ main(argc, argv) conf_read(&q, conf); continue; } - + /* * Accept a new connection * Will get EINTR if a signal has arrived, so just diff --git a/sbin/mount_portalfs/conf.c b/sbin/mount_portalfs/conf.c index 5b335a8..3eb4af3 100644 --- a/sbin/mount_portalfs/conf.c +++ b/sbin/mount_portalfs/conf.c @@ -36,7 +36,7 @@ * * @(#)conf.c 8.2 (Berkeley) 3/27/94 * - * $Id: conf.c,v 1.2 1992/05/27 07:09:27 jsp Exp jsp $ + * $Id: conf.c,v 1.2 1995/02/21 04:05:20 wollman Exp $ */ #include <stdio.h> @@ -131,7 +131,7 @@ qelem *q0; } ins_que(&p0->p_q, q0->q_back); return (1); - + } static path *palloc(cline, lno) diff --git a/sbin/mount_portalfs/mount_portalfs.c b/sbin/mount_portalfs/mount_portalfs.c index 23098d2..51184df 100644 --- a/sbin/mount_portalfs/mount_portalfs.c +++ b/sbin/mount_portalfs/mount_portalfs.c @@ -220,7 +220,7 @@ main(argc, argv) conf_read(&q, conf); continue; } - + /* * Accept a new connection * Will get EINTR if a signal has arrived, so just diff --git a/sbin/mount_umap/mount_umap.c b/sbin/mount_umap/mount_umap.c index ae2ce22..c7e31c6 100644 --- a/sbin/mount_umap/mount_umap.c +++ b/sbin/mount_umap/mount_umap.c @@ -68,12 +68,12 @@ static char sccsid[] = "@(#)mount_umap.c 8.3 (Berkeley) 3/27/94"; /* * This routine provides the user interface to mounting a umap layer. - * It takes 4 mandatory parameters. The mandatory arguments are the place + * It takes 4 mandatory parameters. The mandatory arguments are the place * where the next lower level is mounted, the place where the umap layer is to * be mounted, the name of the user mapfile, and the name of the group * mapfile. The routine checks the ownerships and permissions on the * mapfiles, then opens and reads them. Then it calls mount(), which - * will, in turn, call the umap version of mount. + * will, in turn, call the umap version of mount. */ struct mntopt mopts[] = { @@ -130,7 +130,7 @@ main(argc, argv) #ifdef MAPSECURITY /* * Check that group and other don't have write permissions on - * this mapfile, and that the mapfile belongs to root. + * this mapfile, and that the mapfile belongs to root. */ if (fstat(fileno(fp), &statbuf)) err(1, "%s%s", mapfile, not); @@ -177,7 +177,7 @@ main(argc, argv) #ifdef MAPSECURITY /* * Check that group and other don't have write permissions on - * this group mapfile, and that the file belongs to root. + * this group mapfile, and that the file belongs to root. */ if (fstat(fileno(gfp), &statbuf)) err(1, "%s%s", gmapfile, not); diff --git a/sbin/mount_umapfs/mount_umapfs.c b/sbin/mount_umapfs/mount_umapfs.c index ae2ce22..c7e31c6 100644 --- a/sbin/mount_umapfs/mount_umapfs.c +++ b/sbin/mount_umapfs/mount_umapfs.c @@ -68,12 +68,12 @@ static char sccsid[] = "@(#)mount_umap.c 8.3 (Berkeley) 3/27/94"; /* * This routine provides the user interface to mounting a umap layer. - * It takes 4 mandatory parameters. The mandatory arguments are the place + * It takes 4 mandatory parameters. The mandatory arguments are the place * where the next lower level is mounted, the place where the umap layer is to * be mounted, the name of the user mapfile, and the name of the group * mapfile. The routine checks the ownerships and permissions on the * mapfiles, then opens and reads them. Then it calls mount(), which - * will, in turn, call the umap version of mount. + * will, in turn, call the umap version of mount. */ struct mntopt mopts[] = { @@ -130,7 +130,7 @@ main(argc, argv) #ifdef MAPSECURITY /* * Check that group and other don't have write permissions on - * this mapfile, and that the mapfile belongs to root. + * this mapfile, and that the mapfile belongs to root. */ if (fstat(fileno(fp), &statbuf)) err(1, "%s%s", mapfile, not); @@ -177,7 +177,7 @@ main(argc, argv) #ifdef MAPSECURITY /* * Check that group and other don't have write permissions on - * this group mapfile, and that the file belongs to root. + * this group mapfile, and that the file belongs to root. */ if (fstat(fileno(gfp), &statbuf)) err(1, "%s%s", gmapfile, not); diff --git a/sbin/mountd/mountd.c b/sbin/mountd/mountd.c index 4ca3d3c..0446087 100644 --- a/sbin/mountd/mountd.c +++ b/sbin/mountd/mountd.c @@ -43,7 +43,7 @@ static char copyright[] = #ifndef lint /*static char sccsid[] = "From: @(#)mountd.c 8.8 (Berkeley) 2/20/94";*/ static const char rcsid[] = - "$Id: mountd.c,v 1.5 1995/03/26 23:36:38 wpaul Exp $"; + "$Id: mountd.c,v 1.6 1995/05/21 19:31:09 phk Exp $"; #endif /*not lint*/ #include <sys/param.h> @@ -580,14 +580,14 @@ put_exlist(dp, xdrsp, adp, putdefp) if (!xdr_bool(xdrsp, &true)) return (1); strp = grp->gr_ptr.gt_hostent->h_name; - if (!xdr_string(xdrsp, &strp, + if (!xdr_string(xdrsp, &strp, RPCMNT_NAMELEN)) return (1); } else if (grp->gr_type == GT_NET) { if (!xdr_bool(xdrsp, &true)) return (1); strp = grp->gr_ptr.gt_net.nt_name; - if (!xdr_string(xdrsp, &strp, + if (!xdr_string(xdrsp, &strp, RPCMNT_NAMELEN)) return (1); } diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c index 89f86f5..fc536f0 100644 --- a/sbin/newfs/mkfs.c +++ b/sbin/newfs/mkfs.c @@ -393,7 +393,7 @@ mkfs(pp, fsys, fi, fo) fsize, sblock.fs_fsize); exit(23); } - /* + /* * Calculate the number of cylinders per group */ sblock.fs_cpg = cpg; @@ -645,7 +645,7 @@ next: sblock.fs_cssize - i < sblock.fs_bsize ? sblock.fs_cssize - i : sblock.fs_bsize, ((char *)fscs) + i); - /* + /* * Write out the duplicate super blocks */ for (cylno = 0; cylno < sblock.fs_ncg; cylno++) @@ -712,7 +712,7 @@ initcg(cylno, utime) acg.cg_nclusterblks = acg.cg_ndblk / sblock.fs_frag; acg.cg_btotoff = &acg.cg_space[0] - (u_char *)(&acg.cg_link); acg.cg_boff = acg.cg_btotoff + sblock.fs_cpg * sizeof(long); - acg.cg_iusedoff = acg.cg_boff + + acg.cg_iusedoff = acg.cg_boff + sblock.fs_cpg * sblock.fs_nrpos * sizeof(short); acg.cg_freeoff = acg.cg_iusedoff + howmany(sblock.fs_ipg, NBBY); if (sblock.fs_contigsumsize <= 0) { @@ -1110,7 +1110,7 @@ calloc(size, numelm) free(ptr) char *ptr; { - + /* do not worry about it for now */ } diff --git a/sbin/newlfs/lfs.c b/sbin/newlfs/lfs.c index 72c5f46..4859e30 100644 --- a/sbin/newlfs/lfs.c +++ b/sbin/newlfs/lfs.c @@ -106,7 +106,7 @@ static struct lfs lfs_default = { /* lfs_offset */ 0, /* lfs_lastpseg */ 0, /* lfs_tstamp */ 0, - /* lfs_maxsymlinklen */ MAXSYMLINKLEN, + /* lfs_maxsymlinklen */ MAXSYMLINKLEN, /* lfs_minfree */ MINFREE, /* lfs_maxfilesize */ 0, /* lfs_dbpseg */ DFL_LFSSEG/DEV_BSIZE, @@ -144,7 +144,7 @@ static struct lfs lfs_default = { /* lfs_flags */ 0, /* lfs_fsmnt */ { 0 }, /* lfs_pad */ { 0 }, - /* lfs_pad2 */ { 0 }, + /* lfs_pad2 */ { 0 }, /* lfs_cksum */ 0 }; @@ -161,7 +161,7 @@ struct direct lfs_lf_dir[] = { { ROOTINO, sizeof(struct direct), DT_DIR, 2, ".." }, }; -static daddr_t make_dinode +static daddr_t make_dinode __P((ino_t, struct dinode *, int, daddr_t, struct lfs *)); static void make_dir __P(( void *, struct direct *, int)); static void put __P((int, off_t, void *, size_t)); @@ -251,7 +251,7 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size) lfsp->lfs_nseg = lfsp->lfs_dsize / lfsp->lfs_ssize; lfsp->lfs_maxfilesize = maxtable[lfsp->lfs_bshift] << lfsp->lfs_bshift; - /* + /* * The number of free blocks is set from the number of segments times * the segment size - 2 (that we never write because we need to make * sure the cleaner can run). Then we'll subtract off the room for the @@ -278,7 +278,7 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size) /* Figure out where the superblocks are going to live */ lfsp->lfs_sboffs[0] = LFS_LABELPAD/lp->d_secsize; for (i = 1; i < LFS_MAXNUMSB; i++) { - sb_addr = ((i * sb_interval) << + sb_addr = ((i * sb_interval) << (lfsp->lfs_segshift - lfsp->lfs_bshift + lfsp->lfs_fsbtodb)) + lfsp->lfs_sboffs[0]; if (sb_addr > partp->p_size) @@ -287,15 +287,15 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size) } last_sb_addr = lfsp->lfs_sboffs[i - 1]; lfsp->lfs_lastseg = lfsp->lfs_sboffs[0]; - lfsp->lfs_nextseg = + lfsp->lfs_nextseg = lfsp->lfs_sboffs[1] ? lfsp->lfs_sboffs[1] : lfsp->lfs_sboffs[0]; lfsp->lfs_curseg = lfsp->lfs_lastseg; /* * Initialize the segment usage table. The first segment will - * contain the superblock, the cleanerinfo (cleansz), the segusage - * table * (segtabsz), 1 block's worth of IFILE entries, the root - * directory, the lost+found directory and one block's worth of + * contain the superblock, the cleanerinfo (cleansz), the segusage + * table * (segtabsz), 1 block's worth of IFILE entries, the root + * directory, the lost+found directory and one block's worth of * inodes (containing the ifile, root, and l+f inodes). */ if (!(cleaninfo = malloc(lfsp->lfs_cleansz << lfsp->lfs_bshift))) @@ -317,7 +317,7 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size) lfsp->lfs_bfree -= fsbtodb(lfsp, lfsp->lfs_cleansz + lfsp->lfs_segtabsz + 4); - /* + /* * Now figure out the address of the ifile inode. The inode block * appears immediately after the segment summary. */ @@ -336,27 +336,27 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size) segp->su_nsums = 0; } - /* + /* * Initialize dynamic accounting. The blocks available for * writing are the bfree blocks minus 1 segment summary for * each segment since you can't write any new data without * creating a segment summary - 2 segments that the cleaner * needs. */ - lfsp->lfs_avail = lfsp->lfs_bfree - lfsp->lfs_nseg - + lfsp->lfs_avail = lfsp->lfs_bfree - lfsp->lfs_nseg - fsbtodb(lfsp, 2 * lfsp->lfs_ssize); lfsp->lfs_uinodes = 0; /* * Ready to start writing segments. The first segment is different * because it contains the segment usage table and the ifile inode - * as well as a superblock. For the rest of the segments, set the + * as well as a superblock. For the rest of the segments, set the * time stamp to be 0 so that the first segment is the most recent. * For each segment that is supposed to contain a copy of the super - * block, initialize its first few blocks and its segment summary + * block, initialize its first few blocks and its segment summary * to indicate this. */ lfsp->lfs_nfiles = LFS_FIRST_INUM - 1; - lfsp->lfs_cksum = + lfsp->lfs_cksum = cksum(lfsp, sizeof(struct lfs) - sizeof(lfsp->lfs_cksum)); /* Now create a block of disk inodes */ @@ -370,13 +370,13 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size) fatal("%s", strerror(errno)); ifile = (IFILE *)ipagep; - /* + /* * Initialize IFILE. It is the next block following the * block of inodes (whose address has been calculated in * lfsp->lfs_idaddr; */ sb_addr = lfsp->lfs_idaddr + lfsp->lfs_bsize / lp->d_secsize; - sb_addr = make_dinode(LFS_IFILE_INUM, dip, + sb_addr = make_dinode(LFS_IFILE_INUM, dip, lfsp->lfs_cleansz + lfsp->lfs_segtabsz+1, sb_addr, lfsp); dip->di_mode = IFREG|IREAD|IWRITE; ip = &ifile[LFS_IFILE_INUM]; @@ -404,10 +404,10 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size) /* Make all the other dinodes invalid */ for (i = INOPB(lfsp)-3, dip++; i; i--, dip++) dip->di_inumber = LFS_UNUSED_INUM; - + /* Link remaining IFILE entries in free list */ - for (ip = &ifile[LFS_FIRST_INUM], i = LFS_FIRST_INUM; + for (ip = &ifile[LFS_FIRST_INUM], i = LFS_FIRST_INUM; i < lfsp->lfs_ifpb; ++ip) { ip->if_version = 1; ip->if_daddr = LFS_UNUSED_DADDR; @@ -421,10 +421,10 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size) dp = datasump = malloc (blocks_used * sizeof(u_long)); *dp++ = ((u_long *)dpagep)[0]; /* inode block */ for (i = 0; i < lfsp->lfs_cleansz; i++) - *dp++ = ((u_long *)cleaninfo)[(i << lfsp->lfs_bshift) / + *dp++ = ((u_long *)cleaninfo)[(i << lfsp->lfs_bshift) / sizeof(u_long)]; /* Cleaner info */ for (i = 0; i < lfsp->lfs_segtabsz; i++) - *dp++ = ((u_long *)segtable)[(i << lfsp->lfs_bshift) / + *dp++ = ((u_long *)segtable)[(i << lfsp->lfs_bshift) / sizeof(u_long)]; /* Segusage table */ *dp++ = ((u_long *)ifile)[0]; /* Ifile */ @@ -450,20 +450,20 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size) off += lfsp->lfs_bsize; /* - * use ipagep for space for writing out other stuff. It used to + * use ipagep for space for writing out other stuff. It used to * contain the ifile, but we're done with it. */ /* Write out the root and lost and found directories */ bzero(ipagep, lfsp->lfs_bsize); - make_dir(ipagep, lfs_root_dir, + make_dir(ipagep, lfs_root_dir, sizeof(lfs_root_dir) / sizeof(struct direct)); *dp++ = ((u_long *)ipagep)[0]; put(fd, off, ipagep, lfsp->lfs_bsize); off += lfsp->lfs_bsize; bzero(ipagep, lfsp->lfs_bsize); - make_dir(ipagep, lfs_lf_dir, + make_dir(ipagep, lfs_lf_dir, sizeof(lfs_lf_dir) / sizeof(struct direct)); *dp++ = ((u_long *)ipagep)[0]; put(fd, off, ipagep, lfsp->lfs_bsize); @@ -472,7 +472,7 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size) lfsp->lfs_offset = (off + lfsp->lfs_bsize) / lp->d_secsize; put(fd, LFS_LABELPAD, lfsp, sizeof(struct lfs)); - /* + /* * Finally, calculate all the fields for the summary structure * and write it. */ @@ -536,9 +536,9 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size) file_info.fi_ino = LOSTFOUNDINO; bcopy(&file_info, sump, sizeof(FINFO)); - ((daddr_t *)ipagep)[LFS_SUMMARY_SIZE / sizeof(daddr_t) - 1] = + ((daddr_t *)ipagep)[LFS_SUMMARY_SIZE / sizeof(daddr_t) - 1] = lfsp->lfs_idaddr; - ((SEGSUM *)ipagep)->ss_sumsum = cksum(ipagep+sizeof(summary.ss_sumsum), + ((SEGSUM *)ipagep)->ss_sumsum = cksum(ipagep+sizeof(summary.ss_sumsum), LFS_SUMMARY_SIZE - sizeof(summary.ss_sumsum)); put(fd, LFS_LABELPAD + LFS_SBPAD, ipagep, LFS_SUMMARY_SIZE); @@ -556,9 +556,9 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size) put(fd, off, sp, LFS_SUMMARY_SIZE); /* Now, write rest of segments containing superblocks */ - lfsp->lfs_cksum = + lfsp->lfs_cksum = cksum(lfsp, sizeof(struct lfs) - sizeof(lfsp->lfs_cksum)); - for (seg_addr = last_addr = lfsp->lfs_sboffs[0], j = 1, i = 1; + for (seg_addr = last_addr = lfsp->lfs_sboffs[0], j = 1, i = 1; i < lfsp->lfs_nseg; i++) { seg_addr += lfsp->lfs_ssize << lfsp->lfs_fsbtodb; @@ -571,10 +571,10 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size) j++; put(fd, seg_seek, lfsp, sizeof(struct lfs)); seg_seek += LFS_SBPAD; - } + } /* Summary */ - sp->ss_sumsum = cksum(&sp->ss_datasum, + sp->ss_sumsum = cksum(&sp->ss_datasum, LFS_SUMMARY_SIZE - sizeof(sp->ss_sumsum)); put(fd, seg_seek, sp, LFS_SUMMARY_SIZE); } @@ -649,7 +649,7 @@ make_dinode(ino, dip, nblocks, saddr, lfsp) /* * Construct a set of directory entries in "bufp". We assume that all the - * entries in protodir fir in the first DIRBLKSIZ. + * entries in protodir fir in the first DIRBLKSIZ. */ static void make_dir(bufp, protodir, entries) diff --git a/sbin/newlfs/newfs.c b/sbin/newlfs/newfs.c index 2f7c11f..4f8e72d 100644 --- a/sbin/newlfs/newfs.c +++ b/sbin/newlfs/newfs.c @@ -323,7 +323,7 @@ main(argc, argv) if (bsize <= 0) bsize = MIN(DFL_LFSBLOCK, 8 * fsize); } - + if (segsize == 0) { segsize = pp->p_cpg * bsize; if (segsize <= 0) diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index 256d704..3545c31 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -706,8 +706,8 @@ status() double temp_min = nreceived ? tmin : 0; (void)fprintf(stderr, "%ld/%ld packets received (%ld%%) " "%.3f min / %.3f avg / %.3f max\n", - nreceived, ntransmitted, - (ntransmitted ? + nreceived, ntransmitted, + (ntransmitted ? 100 - (int) (((ntransmitted - nreceived) * 100) / ntransmitted) : 0), @@ -755,7 +755,7 @@ finish() tcsetattr (0, TCSANOW, &ts); } - if (nreceived) + if (nreceived) exit(0); else exit(2); diff --git a/sbin/quotacheck/preen.c b/sbin/quotacheck/preen.c index 1cdb01d..413e4d4 100644 --- a/sbin/quotacheck/preen.c +++ b/sbin/quotacheck/preen.c @@ -121,7 +121,7 @@ checkfstab(preen, maxrun, docheck, chkit) maxrun = ndisks; nextdisk = disks; for (passno = 0; passno < maxrun; ++passno) { - while ((ret = startdisk(nextdisk, chkit)) != 0 && + while ((ret = startdisk(nextdisk, chkit)) != 0 && nrun > 0) sleep(10); if (ret) diff --git a/sbin/rdisc/rdisc.c b/sbin/rdisc/rdisc.c index b9c674c..6f057b3 100644 --- a/sbin/rdisc/rdisc.c +++ b/sbin/rdisc/rdisc.c @@ -1,8 +1,8 @@ /* - * Rdisc (this program) was developed by Sun Microsystems, Inc. and is - * provided for unrestricted use provided that this legend is included on - * all tape media and as a part of the software program in whole or part. - * Users may copy or modify Rdisc without charge, and they may freely + * Rdisc (this program) was developed by Sun Microsystems, Inc. and is + * provided for unrestricted use provided that this legend is included on + * all tape media and as a part of the software program in whole or part. + * Users may copy or modify Rdisc without charge, and they may freely * distribute it. * * RDISC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE @@ -57,7 +57,7 @@ #include <string.h> #include <syslog.h> -/* +/* * TBD * Use 255.255.255.255 for broadcasts - not the interface broadcast * address. @@ -162,7 +162,7 @@ int solicit = 0; int responder; int ntransmitted = 0; int nreceived = 0; -int forever = 0; /* Never give up on host. If 0 defer fork until +int forever = 0; /* Never give up on host. If 0 defer fork until * first response. */ @@ -177,7 +177,7 @@ int preference = 0; /* Setable with -p option */ /* Host variables */ int max_solicitations = MAX_SOLICITATIONS; unsigned int solicitation_interval = SOLICITATION_INTERVAL; -int best_preference = 1; /* Set to record only the router(s) with the +int best_preference = 1; /* Set to record only the router(s) with the best preference in the kernel. Not set puts all routes in the kernel. */ @@ -196,7 +196,7 @@ do_fork() { int t; long pid; - + if (trace) return; @@ -271,7 +271,7 @@ char *argv[]; if (argc != 0) { val = strtol(av[0], (char **)NULL, 0); if (val < 4 || val > 1800) { - (void) fprintf(stderr, + (void) fprintf(stderr, "Bad Max Advertizement Interval\n"); exit(1); } @@ -281,7 +281,7 @@ char *argv[]; } else { prusage(); /* NOTREACHED*/ - } + } goto next; case 'p': argc--, av++; @@ -403,7 +403,7 @@ char *argv[]; int fromlen = sizeof (from); int cc; - if ( (cc=recvfrom(s, (char *)packet, len, 0, + if ( (cc=recvfrom(s, (char *)packet, len, 0, (struct sockaddr *)&from, &fromlen)) < 0) { if( errno == EINTR ) continue; @@ -444,8 +444,8 @@ void timer() if (ntransmitted < initial_advertisements) left_until_advertise = initial_advert_interval; else - left_until_advertise = min_adv_int + - ((max_adv_int - min_adv_int) * + left_until_advertise = min_adv_int + + ((max_adv_int - min_adv_int) * (random() % 1000)/1000); } else if (solicit && left_until_solicit <= 0) { ntransmitted++; @@ -464,9 +464,9 @@ void timer() /* * S O L I C I T O R - * - * Compose and transmit an ICMP ROUTER SOLICITATION REQUEST packet. - * The IP packet will be added on by the kernel. + * + * Compose and transmit an ICMP ROUTER SOLICITATION REQUEST packet. + * The IP packet will be added on by the kernel. */ void solicitor(sin) @@ -475,7 +475,7 @@ solicitor(sin) static u_char outpack[MAXPACKET]; register struct icmp *icp = (struct icmp *) ALLIGN(outpack); int packetlen, i; - + if (verbose) { logtrace("Sending solicitation to %s\n", pr_name(sin->sin_addr)); @@ -489,7 +489,7 @@ solicitor(sin) /* Compute ICMP checksum here */ icp->icmp_cksum = in_cksum( (u_short *)icp, packetlen ); - if (isbroadcast(sin)) + if (isbroadcast(sin)) i = sendbcast(s, (char *)outpack, packetlen); else if (ismulticast(sin)) i = sendmcast( s, (char *)outpack, packetlen, sin); @@ -508,9 +508,9 @@ solicitor(sin) /* * A V E R T I S E - * - * Compose and transmit an ICMP ROUTER ADVERTISEMENT packet. - * The IP packet will be added on by the kernel. + * + * Compose and transmit an ICMP ROUTER ADVERTISEMENT packet. + * The IP packet will be added on by the kernel. */ void advertise(sin) @@ -520,23 +520,23 @@ advertise(sin) register struct icmp_ra *rap = (struct icmp_ra *) ALLIGN(outpack); struct icmp_ra_addr *ap; int packetlen, i, cc; - + if (verbose) { logtrace("Sending advertisement to %s\n", pr_name(sin->sin_addr)); } - + for (i = 0; i < num_interfaces; i++) { rap->icmp_type = ICMP_ROUTER_ADVERTISEMENT; rap->icmp_code = 0; rap->icmp_cksum = 0; - rap->icmp_num_addrs = 0; + rap->icmp_num_addrs = 0; rap->icmp_wpa = 2; rap->icmp_lifetime = lifetime; packetlen = 8; - /* - * TODO handle multiple logical interfaces per + /* + * TODO handle multiple logical interfaces per * physical interface. (increment with rap->icmp_wpa * 4 for * each address.) */ @@ -550,15 +550,15 @@ advertise(sin) /* Compute ICMP checksum here */ rap->icmp_cksum = in_cksum( (u_short *)rap, packetlen ); - if (isbroadcast(sin)) - cc = sendbcastif(s, (char *)outpack, packetlen, + if (isbroadcast(sin)) + cc = sendbcastif(s, (char *)outpack, packetlen, &interfaces[i]); else if (ismulticast(sin)) cc = sendmcastif( s, (char *)outpack, packetlen, sin, &interfaces[i]); else { struct interface *ifp = &interfaces[i]; - /* + /* * Verify that the interface matches the destination * address. */ @@ -567,11 +567,11 @@ advertise(sin) if (debug) { logdebug("Unicast to %s ", pr_name(sin->sin_addr)); - logdebug("on interface %s\n", + logdebug("on interface %s\n", pr_name(ifp->address)); } cc = sendto( s, (char *)outpack, packetlen, 0, - (struct sockaddr *)sin, + (struct sockaddr *)sin, sizeof(struct sockaddr)); } else cc = packetlen; @@ -637,7 +637,7 @@ char *pr_name(addr) static char buf[256]; phe = gethostbyaddr((char *)&addr.s_addr, 4, AF_INET); - if (phe == NULL) + if (phe == NULL) return( inet_ntoa(addr)); (void) sprintf(buf, "%s (%s)", phe->h_name, inet_ntoa(addr)); return(buf); @@ -711,7 +711,7 @@ struct sockaddr_in *from; return; } if (rap->icmp_num_addrs < 1) { - if (verbose) + if (verbose) logtrace("ICMP %s from %s: No addresses\n", pr_type((int)rap->icmp_type), pr_name(from->sin_addr)); @@ -725,14 +725,14 @@ struct sockaddr_in *from; rap->icmp_wpa); return; } - if ((unsigned)cc < + if ((unsigned)cc < ICMP_MINLEN + rap->icmp_num_addrs * rap->icmp_wpa * 4) { if (verbose) logtrace("ICMP %s from %s: Too short %d, %d\n", pr_type((int)rap->icmp_type), pr_name(from->sin_addr), - cc, - ICMP_MINLEN + + cc, + ICMP_MINLEN + rap->icmp_num_addrs * rap->icmp_wpa * 4); return; } @@ -756,16 +756,16 @@ struct sockaddr_in *from; for (i = 0; (unsigned)i < rap->icmp_num_addrs; i++) { struct in_addr ina; ap = (struct icmp_ra_addr *) - ALLIGN(buf + hlen + ICMP_MINLEN + + ALLIGN(buf + hlen + ICMP_MINLEN + i * rap->icmp_wpa * 4); ina.s_addr = ntohl(ap->addr); if (verbose) - logtrace("\taddress %s, preference 0x%x\n", + logtrace("\taddress %s, preference 0x%x\n", pr_name(ina), ntohl(ap->preference)); if (!responder) { if (is_directly_connected(ina)) - record_router(ina, + record_router(ina, (long)ntohl(ap->preference), rap->icmp_lifetime); } @@ -782,7 +782,7 @@ struct sockaddr_in *from; } break; } - + case ICMP_ROUTER_SOLICITATION: { struct sockaddr_in sin; @@ -818,7 +818,7 @@ struct sockaddr_in *from; logtrace("ICMP %s from %s: Too short %d, %d\n", pr_type((int)icp->icmp_type), pr_name(from->sin_addr), - cc, + cc, ICMP_MINLEN); return; } @@ -827,8 +827,8 @@ struct sockaddr_in *from; logtrace("ICMP %s from %s\n", pr_type((int)icp->icmp_type), pr_name(from->sin_addr)); - - if (!responder) + + if (!responder) break; /* Check that ip_src is either a neighboor @@ -844,8 +844,8 @@ struct sockaddr_in *from; else sin.sin_addr.s_addr = INADDR_BROADCAST; /* Restart the timer when we broadcast */ - left_until_advertise = min_adv_int + - ((max_adv_int - min_adv_int) + left_until_advertise = min_adv_int + + ((max_adv_int - min_adv_int) * (random() % 1000)/1000); } else { @@ -932,7 +932,7 @@ finish() interfaces[i].preference = IGNORE_PREFERENCE; ntransmitted++; advertise(&whereto); - } + } logtrace("\n----%s rdisc Statistics----\n", sendaddress ); logtrace("%d packets transmitted, ", ntransmitted ); logtrace("%d packets received, ", nreceived ); @@ -955,25 +955,25 @@ unsigned char *data; while (len) { register int i; char charstring[17]; - + (void)strcpy(charstring," "); /* 16 spaces */ for (i = 0; i < 16; i++) { - /* output the bytes one at a time, - * not going pas "len" bytes + /* output the bytes one at a time, + * not going pas "len" bytes */ if (len) { char ch = *data & 0x7f; /* strip parity */ - if (!isprint((u_char)ch)) + if (!isprint((u_char)ch)) ch = ' '; /* ensure printable */ charstring[i] = ch; (void) fprintf(out,"%02x ",*data++); len--; - } else + } else (void) fprintf(out," "); - if (i==7) + if (i==7) (void) fprintf(out," "); } - + (void) fprintf(out," *%s*\n",charstring); } } @@ -1000,7 +1000,7 @@ sendbcast(s, packet, packetlen) int packetlen; { int i, cc; - + for (i = 0; i < num_interfaces; i++) { if ((interfaces[i].flags & IFF_BROADCAST) == 0) continue; @@ -1023,7 +1023,7 @@ sendbcastif(s, packet, packetlen, ifp) struct sockaddr_in baddr; baddr.sin_family = AF_INET; - + if ((ifp->flags & IFF_BROADCAST) == 0) return (packetlen); @@ -1049,7 +1049,7 @@ sendmcast(s, packet, packetlen, sin) struct sockaddr_in *sin; { int i, cc; - + for (i = 0; i < num_interfaces; i++) { if ((interfaces[i].flags & IFF_MULTICAST) == 0) continue; @@ -1059,7 +1059,7 @@ sendmcast(s, packet, packetlen, sin) } } return (packetlen); -} +} int sendmcastif(s, packet, packetlen, sin, ifp) @@ -1073,7 +1073,7 @@ sendmcastif(s, packet, packetlen, sin, ifp) struct sockaddr_in ifaddr; ifaddr.sin_family = AF_INET; - + if ((ifp->flags & IFF_MULTICAST) == 0) return (packetlen); @@ -1081,7 +1081,7 @@ sendmcastif(s, packet, packetlen, sin, ifp) if (debug) logdebug("Multicast to interface %s\n", pr_name(ifaddr.sin_addr)); - if (setsockopt(s, IPPROTO_IP, IP_MULTICAST_IF, + if (setsockopt(s, IPPROTO_IP, IP_MULTICAST_IF, (char *)&ifaddr.sin_addr, sizeof(ifaddr.sin_addr)) < 0) { logperror("setsockopt (IP_MULTICAST_IF)"); @@ -1140,7 +1140,7 @@ initifs() (void) close(sock); return; } - if (interfaces) + if (interfaces) interfaces = (struct interface *)ALLIGN(realloc((char *)interfaces, numifs * sizeof(struct interface))); else @@ -1153,7 +1153,7 @@ initifs() return; } interfaces_size = numifs; - + ifc.ifc_len = bufsize; ifc.ifc_buf = buf; if (ioctl(sock, SIOCGIFCONF, (char *)&ifc) < 0) { @@ -1169,7 +1169,7 @@ initifs() logperror("initifs: ioctl (get interface flags)"); continue; } - if (ifr->ifr_addr.sa_family != AF_INET) + if (ifr->ifr_addr.sa_family != AF_INET) continue; if ((ifreq.ifr_flags & IFF_UP) == 0) continue; @@ -1229,7 +1229,7 @@ initifs() (void) free(buf); } -static int +static int join(sock, sin) int sock; struct sockaddr_in *sin; @@ -1264,7 +1264,7 @@ int support_multicast() return (0); } - if (setsockopt(sock, IPPROTO_IP, IP_MULTICAST_TTL, + if (setsockopt(sock, IPPROTO_IP, IP_MULTICAST_TTL, (char *)&ttl, sizeof(ttl)) < 0) { (void) close(sock); return (0); @@ -1282,7 +1282,7 @@ is_directly_connected(in) for (i = 0; i < num_interfaces; i++) { /* Check that the subnetwork numbers match */ - if ((in.s_addr & interfaces[i].netmask.s_addr ) == + if ((in.s_addr & interfaces[i].netmask.s_addr ) == (interfaces[i].remoteaddr.s_addr & interfaces[i].netmask.s_addr)) return (1); } @@ -1342,15 +1342,15 @@ age_table(time) int recalculate_max = 0; int max = max_preference(); - tpp = &table; + tpp = &table; while (*tpp != NULL) { tp = *tpp; tp->remaining_time -= time; if (tp->remaining_time <= 0) { *tpp = tp->next; - if (tp->in_kernel) + if (tp->in_kernel) del_route(tp->router); - if (best_preference && + if (best_preference && tp->preference == max) recalculate_max++; free((char *)tp); @@ -1384,9 +1384,9 @@ record_router(router, preference, ttl) int old_max = max_preference(); int changed_up = 0; /* max preference could have increased */ int changed_down = 0; /* max preference could have decreased */ - + if (debug) - logdebug("Recording %s, preference 0x%x\n", + logdebug("Recording %s, preference 0x%x\n", pr_name(router), preference); tp = find_router(router); @@ -1413,7 +1413,7 @@ record_router(router, preference, ttl) tp->next = table; table = tp; } - if (!tp->in_kernel && + if (!tp->in_kernel && (!best_preference || tp->preference == max_preference()) && tp->preference != IGNORE_PREFERENCE) { add_route(tp->router); @@ -1429,7 +1429,7 @@ record_router(router, preference, ttl) if (new_max != IGNORE_PREFERENCE) { tp = table; while (tp) { - if (tp->preference == new_max && + if (tp->preference == new_max && !tp->in_kernel) { add_route(tp->router); tp->in_kernel++; @@ -1452,7 +1452,7 @@ record_router(router, preference, ttl) } } - + #include <net/route.h> void @@ -1487,7 +1487,7 @@ rtioctl(addr, op) sin = (struct sockaddr_in *)ALLIGN(&rt.rt_gateway); sin->sin_addr = addr; rt.rt_flags = RTF_UP | RTF_GATEWAY; - + sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); if (sock < 0) { logperror("rtioctl: socket"); @@ -1501,7 +1501,7 @@ rtioctl(addr, op) } - + /* * LOGGER */ diff --git a/sbin/rdisc/rdisc.h b/sbin/rdisc/rdisc.h index 8a3d845..507c9ce 100644 --- a/sbin/rdisc/rdisc.h +++ b/sbin/rdisc/rdisc.h @@ -16,4 +16,4 @@ struct ip_mreq { struct in_addr imr_multiaddr; /* IP multicast address of group */ struct in_addr imr_interface; /* local IP address of interface */ }; - + diff --git a/sbin/restore/dirs.c b/sbin/restore/dirs.c index 79c9897..8860f5b 100644 --- a/sbin/restore/dirs.c +++ b/sbin/restore/dirs.c @@ -207,7 +207,7 @@ skipdirs() } /* - * Recursively find names and inumbers of all files in subtree + * Recursively find names and inumbers of all files in subtree * pname and pass them off to be processed. */ void @@ -477,7 +477,7 @@ rst_readdir(dirp) for (;;) { if (dirp->dd_loc == 0) { - dirp->dd_size = read(dirp->dd_fd, dirp->dd_buf, + dirp->dd_size = read(dirp->dd_fd, dirp->dd_buf, DIRBLKSIZ); if (dirp->dd_size <= 0) { dprintf(stderr, "error reading directory\n"); @@ -583,7 +583,7 @@ setdirmodes(flags) struct modeinfo node; struct entry *ep; char *cp; - + vprintf(stdout, "Set directory mode, owner, and times.\n"); (void) sprintf(modefile, "%s/rstmode%d", _PATH_TMP, dumpdate); mf = fopen(modefile, "r"); diff --git a/sbin/restore/restore.c b/sbin/restore/restore.c index dea964c..97bd6cc 100644 --- a/sbin/restore/restore.c +++ b/sbin/restore/restore.c @@ -130,7 +130,7 @@ deletefile(name, ino, type) return (descend); } -/* +/* * The following four routines implement the incremental * restore algorithm. The first removes old entries, the second * does renames and calculates the extraction list, the third @@ -139,7 +139,7 @@ deletefile(name, ino, type) * * Directories cannot be immediately deleted, as they may have * other files in them which need to be moved out first. As - * directories to be deleted are found, they are put on the + * directories to be deleted are found, they are put on the * following deletion list. After all deletions and renames * are done, this list is actually deleted. */ @@ -203,7 +203,7 @@ nodeupdates(name, ino, type) # define MODECHG 0x8 /* mode of inode changed */ /* - * This routine is called once for each element in the + * This routine is called once for each element in the * directory hierarchy, with a full path name. * The "type" value is incorrectly specified as LEAF for * directories that are not on the dump tape. @@ -394,7 +394,7 @@ nodeupdates(name, ino, type) * that we need to rename, so we delete it from the symbol * table, and put it on the list to be deleted eventually. * Conversely if a directory is to be created, it must be - * done immediately, rather than waiting until the + * done immediately, rather than waiting until the * extraction phase. */ case ONTAPE|INOFND|MODECHG: @@ -464,7 +464,7 @@ nodeupdates(name, ino, type) default: panic("[%s] %s: impossible state\n", keyval(key), name); break; - } + } return (descend); } @@ -606,7 +606,7 @@ createleaves(symtabfile) /* * If we find files on the tape that have no corresponding * directory entries, then we must have found a file that - * was created while the dump was in progress. Since we have + * was created while the dump was in progress. Since we have * no name for it, we discard it knowing that it will be * on the next incremental tape. */ diff --git a/sbin/restore/symtab.c b/sbin/restore/symtab.c index 3895ec0..9488a7f 100644 --- a/sbin/restore/symtab.c +++ b/sbin/restore/symtab.c @@ -366,7 +366,7 @@ removeentry(ep) /* * Table of unused string entries, sorted by length. - * + * * Entries are allocated in STRTBLINCR sized pieces so that names * of similar lengths can use the same entry. The value of STRTBLINCR * is chosen so that every entry has at least enough space to hold @@ -422,7 +422,7 @@ freename(name) char *name; { struct strhdr *tp, *np; - + tp = &strtblhdr[strlen(name) / STRTBLINCR]; np = (struct strhdr *)name; np->next = tp->next; diff --git a/sbin/restore/tape.c b/sbin/restore/tape.c index 965a28e..ebfa555 100644 --- a/sbin/restore/tape.c +++ b/sbin/restore/tape.c @@ -300,7 +300,7 @@ again: if (command == 'R' || command == 'r' || curfile.action != SKIP) { newvol = nextvol; wantnext = 1; - } else { + } else { newvol = 0; wantnext = 0; } @@ -398,7 +398,7 @@ gethdr: * If coming to this volume at random, skip to the beginning * of the next record. */ - dprintf(stdout, "read %ld recs, tape starts with %ld\n", + dprintf(stdout, "read %ld recs, tape starts with %ld\n", tpblksread, tmpbuf.c_firstrec); if (tmpbuf.c_type == TS_TAPE && (tmpbuf.c_flags & DR_NEWHEADER)) { if (!wantnext) { @@ -477,7 +477,7 @@ setdumpnum() #ifdef RRESTORE if (host) rmtioctl(MTFSF, dumpnum - 1); - else + else #endif if (ioctl(mt, (int)MTIOCTOP, (char *)&tcom) < 0) fprintf(stderr, "ioctl MTFSF: %s\n", strerror(errno)); @@ -1094,7 +1094,7 @@ good: break; } /* - * If we are restoring a filesystem with old format inodes, + * If we are restoring a filesystem with old format inodes, * copy the uid/gid to the new location. */ if (oldinofmt) { @@ -1247,11 +1247,11 @@ checksum(buf) } else { /* What happens if we want to read restore tapes for a 16bit int machine??? */ - do + do i += swabl(*buf++); while (--j); } - + if (i != CHECKSUM) { fprintf(stderr, "Checksum error %o, inode %d file %s\n", i, curfile.ino, curfile.name); @@ -1328,7 +1328,7 @@ swabst(cp, sp) case '5': case '6': case '7': case '8': case '9': n = (n * 10) + (*cp++ - '0'); continue; - + case 's': case 'w': case 'h': if (n == 0) n = 1; diff --git a/sbin/restore/utilities.c b/sbin/restore/utilities.c index 31fd11c..b2e442e 100644 --- a/sbin/restore/utilities.c +++ b/sbin/restore/utilities.c @@ -329,7 +329,7 @@ dirlookup(name) { struct direct *dp; ino_t ino; - + ino = ((dp = pathsearch(name)) == NULL) ? 0 : dp->d_ino; if (ino == 0 || TSTINO(ino, dumpmap) == 0) diff --git a/sbin/savecore/savecore.c b/sbin/savecore/savecore.c index 6ee6141..cb583b3 100644 --- a/sbin/savecore/savecore.c +++ b/sbin/savecore/savecore.c @@ -203,7 +203,7 @@ kmem_setup() FILE *fp; int kmem, i; const char *dump_sys; - + /* * Some names we need for the currently running system, others for * the system that was running when the dump was made. The values @@ -213,7 +213,7 @@ kmem_setup() * the same!) */ if ((nlist(getbootfile(), current_nl)) == -1) - syslog(LOG_ERR, "%s: nlist: %s", getbootfile(), + syslog(LOG_ERR, "%s: nlist: %s", getbootfile(), strerror(errno)); for (i = 0; cursyms[i] != -1; i++) if (current_nl[cursyms[i]].n_value == 0) { @@ -410,7 +410,7 @@ err2: syslog(LOG_WARNING, (void)close(ifd); if (compress) (void)fclose(fp); - else + else (void)close(ofd); /* Copy the kernel. */ diff --git a/sbin/scsi/scsi.c b/sbin/scsi/scsi.c index 3303197..24ccd9f 100644 --- a/sbin/scsi/scsi.c +++ b/sbin/scsi/scsi.c @@ -2,11 +2,11 @@ * Written By Julian ELischer * Copyright julian Elischer 1993. * Permission is granted to use or redistribute this file in any way as long - * as this notice remains. Julian Elischer does not guarantee that this file - * is totally correct for any given task and users of this file must + * as this notice remains. Julian Elischer does not guarantee that this file + * is totally correct for any given task and users of this file must * accept responsibility for any damage that occurs from the application of this * file. - * + * * (julian@tfs.com julian@dialix.oz.au) * * User SCSI hooks added by Peter Dufault: @@ -14,7 +14,7 @@ * Copyright (c) 1994 HD Associates * (contact: dufault@hda.com) * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -26,7 +26,7 @@ * 3. The name of HD Associates * may not be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY HD ASSOCIATES ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -39,7 +39,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: scsi.c,v 1.6 1995/05/01 12:54:32 dufault Exp $ + * $Id: scsi.c,v 1.7 1995/05/05 20:42:00 dufault Exp $ */ #include <stdio.h> @@ -540,7 +540,7 @@ static char *mode_lookup(int page) if (c == EOF) { fprintf(stderr, "Expected %c.\n", END_ENTRY); } - + if (c == START_ENTRY) { match++; } @@ -757,7 +757,7 @@ mode_edit(int fd, int page, int edit, int argc, char *argv[]) edit_edit(); edit_rewind(); - scsireq_buff_encode_visit(mode_pars, mh->mdl, + scsireq_buff_encode_visit(mode_pars, mh->mdl, fmt, edit_get, 0); /* Eliminate block descriptors: @@ -884,7 +884,7 @@ void main(int argc, char **argv) } else if(reprobe) { scaddr.scbus = bus; scaddr.target = targ; - scaddr.lun = lun; + scaddr.lun = lun; if (ioctl(fd,SCIOCREPROBE,&scaddr) == -1) perror("ioctl"); diff --git a/sbin/slattach/slattach.c b/sbin/slattach/slattach.c index 8bac57e..915175f 100644 --- a/sbin/slattach/slattach.c +++ b/sbin/slattach/slattach.c @@ -185,7 +185,7 @@ int main(int argc, char **argv) cp++; /* trailing tty pathname component */ sprintf(pidfilename, "%sslattach.%s.pid", _PATH_VARRUN, cp); printf("%s\n",pidfilename); - + if (!foreground) daemon(0,0); /* fork, setsid, chdir /, and close std*. */ /* daemon() closed stderr, so log errors from here on. */ @@ -252,7 +252,7 @@ void acquire_line() fprintf(pidfile, "%ld\n", getpid()); fclose(pidfile); } - + if ((int)signal(SIGHUP,sighup_handler) < 0) /* Re-enable HUP signal */ syslog(LOG_NOTICE,"cannot install SIGHUP handler: %m"); diff --git a/sbin/startslip/startslip.c b/sbin/startslip/startslip.c index 5db7815..1592073 100644 --- a/sbin/startslip/startslip.c +++ b/sbin/startslip/startslip.c @@ -199,7 +199,7 @@ main(argc, argv) if (debug) setbuf(stdout, NULL); - + if (pfd = fopen(PIDFILE, "r")) { pid = 0; fscanf(pfd, "%d", &pid); @@ -309,7 +309,7 @@ restart: if (tcsetattr(fd, TCSAFLUSH, &t) < 0) { perror("tcsetattr"); syslog(LOG_ERR, "%s: tcsetattr: %m\n", devicename); - if (first) + if (first) exit(2); else { syslog(LOG_INFO, "sleeping %d seconds (%d tries).\n", wait_time * tries, tries); @@ -331,7 +331,7 @@ restart: perror("ioctl (TIOCSETP)"); syslog(LOG_ERR, "%s: ioctl (TIOCSETP): %m\n", devicename); - if (first) + if (first) exit(2); else { syslog(LOG_INFO, "sleeping %d seconds (%d tries).\n", wait_time * tries, tries); @@ -396,7 +396,7 @@ restart: } } } - + /* * Attach */ @@ -467,7 +467,7 @@ getline(buf, size, fd, timeout) tv.tv_sec = timeout; tv.tv_usec = 0; if ((ret = select(fd + 1, &readfds, NULL, NULL, &tv)) < 0) { - if (errno != EINTR) + if (errno != EINTR) perror("getline: select"); } else { if (! ret) { diff --git a/sbin/tunefs/tunefs.c b/sbin/tunefs/tunefs.c index 583dbff..e277a71 100644 --- a/sbin/tunefs/tunefs.c +++ b/sbin/tunefs/tunefs.c @@ -87,7 +87,7 @@ main(argc, argv) struct fstab *fs; char *chg[2], device[MAXPATHLEN]; - argc--, argv++; + argc--, argv++; if (argc < 2) usage(); special = argv[argc - 1]; diff --git a/sbin/umount/umount.c b/sbin/umount/umount.c index 24d7001..ad64d53 100644 --- a/sbin/umount/umount.c +++ b/sbin/umount/umount.c @@ -121,7 +121,7 @@ main(argc, argv) /* -h implies "-t nfs" if no -t flag. */ if ((nfshost != NULL) && (typelist == NULL)) maketypelist("nfs"); - + if (all) { if (setfsent() == 0) err(1, "%s", _PATH_FSTAB); @@ -159,7 +159,7 @@ umountall() if (!selected(type)) continue; - /* + /* * We want to unmount the file systems in the reverse order * that they were mounted. So, we save off the file name * in some allocated memory, and then call recursively. |