BSD 4_3_Tahoe release
[unix-history] / usr / src / bin / df.c
index bf960cd..8b6db84 100644 (file)
@@ -8,11 +8,11 @@
 char copyright[] =
 "@(#) Copyright (c) 1980 Regents of the University of California.\n\
  All rights reserved.\n";
 char copyright[] =
 "@(#) Copyright (c) 1980 Regents of the University of California.\n\
  All rights reserved.\n";
-#endif not lint
+#endif /* not lint */
 
 #ifndef lint
 
 #ifndef lint
-static char sccsid[] = "@(#)df.c       5.1 (Berkeley) 4/30/85";
-#endif not lint
+static char sccsid[] = "@(#)df.c       5.3 (Berkeley) 1/10/88";
+#endif /* not lint */
 
 #include <sys/param.h>
 #include <sys/fs.h>
 
 #include <sys/param.h>
 #include <sys/fs.h>
@@ -85,7 +85,7 @@ main(argc, argv)
                                (void) strcpy(root, fsp->fs_spec);
                        dfree(fsp->fs_spec, 1);
                }
                                (void) strcpy(root, fsp->fs_spec);
                        dfree(fsp->fs_spec, 1);
                }
-               endfsent();
+               (void)endfsent();
                exit(0);
        }
        for (i=1; i<argc; i++)
                exit(0);
        }
        for (i=1; i<argc; i++)
@@ -107,18 +107,18 @@ dfree(file, infsent)
                        fprintf(stderr, "%s: screwy /etc/fstab entry\n", file);
                        return;
                }
                        fprintf(stderr, "%s: screwy /etc/fstab entry\n", file);
                        return;
                }
-               setfsent();
+               (void)setfsent();
                while (fsp = getfsent()) {
                        struct stat stb;
 
                        if (stat(fsp->fs_spec, &stb) == 0 &&
                            stb.st_rdev == stbuf.st_dev) {
                                file = fsp->fs_spec;
                while (fsp = getfsent()) {
                        struct stat stb;
 
                        if (stat(fsp->fs_spec, &stb) == 0 &&
                            stb.st_rdev == stbuf.st_dev) {
                                file = fsp->fs_spec;
-                               endfsent();
+                               (void)endfsent();
                                goto found;
                        }
                }
                                goto found;
                        }
                }
-               endfsent();
+               (void)endfsent();
                fprintf(stderr, "%s: mounted on unknown device\n", file);
                return;
        }
                fprintf(stderr, "%s: mounted on unknown device\n", file);
                return;
        }
@@ -128,7 +128,7 @@ found:
                perror(file);
                return;
        }
                perror(file);
                return;
        }
-       if (bread(SBLOCK, (char *)&sblock, SBSIZE) == 0) {
+       if (bread((long)SBOFF, (char *)&sblock, SBSIZE) == 0) {
                (void) close(fi);
                return;
        }
                (void) close(fi);
                return;
        }
@@ -156,18 +156,18 @@ found:
 
 long lseek();
 
 
 long lseek();
 
-bread(bno, buf, cnt)
-       daddr_t bno;
+bread(off, buf, cnt)
+       long off;
        char *buf;
 {
        int n;
        extern errno;
 
        char *buf;
 {
        int n;
        extern errno;
 
-       (void) lseek(fi, (long)(bno * DEV_BSIZE), 0);
+       (void) lseek(fi, off, 0);
        if ((n=read(fi, buf, cnt)) != cnt) {
                /* probably a dismounted disk if errno == EIO */
                if (errno != EIO) {
        if ((n=read(fi, buf, cnt)) != cnt) {
                /* probably a dismounted disk if errno == EIO */
                if (errno != EIO) {
-                       printf("\nread error bno = %ld\n", bno);
+                       printf("\nread error off = %ld\n", off);
                        printf("count = %d; errno = %d\n", n, errno);
                }
                return (0);
                        printf("count = %d; errno = %d\n", n, errno);
                }
                return (0);