added calls to fstab routines
authorBill Joy <root@ucbvax.Berkeley.EDU>
Tue, 14 Oct 1980 09:38:04 +0000 (01:38 -0800)
committerBill Joy <root@ucbvax.Berkeley.EDU>
Tue, 14 Oct 1980 09:38:04 +0000 (01:38 -0800)
SCCS-vsn: old/dump.4.1/dumpoptr.c 1.2
SCCS-vsn: sbin/dump/optr.c 1.2

usr/src/old/dump.4.1/dumpoptr.c
usr/src/sbin/dump/optr.c

index a27282d..526b90e 100644 (file)
@@ -1,4 +1,4 @@
-static char *sccsid = "@(#)dumpoptr.c  1.1 (Berkeley) %G%";
+static char *sccsid = "@(#)dumpoptr.c  1.2 (Berkeley) %G%";
 #include "dump.h"
 
 /*
 #include "dump.h"
 
 /*
@@ -279,21 +279,23 @@ msgtail(fmt, a1, a2, a3, a4, a5)
 getfstab()
 {
        register        struct  fstab   *dt;
 getfstab()
 {
        register        struct  fstab   *dt;
-                       FILE    *fstabfile;
+                       struct  fstab   *fsp;
 
        nfstab = 0;
 
        nfstab = 0;
-       if ( (fstabfile = fopen(FSTAB, "r")) == NULL){
+       if (setfsent() == 0) {
                msg("Can't open %s for dump table information.\n", FSTAB);
        } else {
                for (nfstab = 0, dt = fstab; nfstab < MAXFSTAB;){
                msg("Can't open %s for dump table information.\n", FSTAB);
        } else {
                for (nfstab = 0, dt = fstab; nfstab < MAXFSTAB;){
-                       if (feof(fstabfile))
+                       if ( (fsp = getfsent()) == 0)
                                break;
                                break;
-                       fscanf(fstabfile, FSTABFMT, FSTABARG(dt));
-                       if (!strcmp(dt->fs_type, "rw") ||
-                           !strcmp(dt->fs_type, "ro"))
-                               nfstab++, dt++;
+                       if (   (strcmp(fsp->fs_type, FSTAB_RW) == 0)
+                           || (strcmp(fsp->fs_type, FSTAB_RO) == 0) ){
+                               *dt = *fsp;
+                               nfstab++; 
+                               dt++;
+                       }
                }
                }
-               fclose(fstabfile);
+               endfsent();
        }
 }
 
        }
 }
 
index e567035..5a62a48 100644 (file)
@@ -1,4 +1,4 @@
-static char *sccsid = "@(#)optr.c      1.1 (Berkeley) %G%";
+static char *sccsid = "@(#)optr.c      1.2 (Berkeley) %G%";
 #include "dump.h"
 
 /*
 #include "dump.h"
 
 /*
@@ -279,21 +279,23 @@ msgtail(fmt, a1, a2, a3, a4, a5)
 getfstab()
 {
        register        struct  fstab   *dt;
 getfstab()
 {
        register        struct  fstab   *dt;
-                       FILE    *fstabfile;
+                       struct  fstab   *fsp;
 
        nfstab = 0;
 
        nfstab = 0;
-       if ( (fstabfile = fopen(FSTAB, "r")) == NULL){
+       if (setfsent() == 0) {
                msg("Can't open %s for dump table information.\n", FSTAB);
        } else {
                for (nfstab = 0, dt = fstab; nfstab < MAXFSTAB;){
                msg("Can't open %s for dump table information.\n", FSTAB);
        } else {
                for (nfstab = 0, dt = fstab; nfstab < MAXFSTAB;){
-                       if (feof(fstabfile))
+                       if ( (fsp = getfsent()) == 0)
                                break;
                                break;
-                       fscanf(fstabfile, FSTABFMT, FSTABARG(dt));
-                       if (!strcmp(dt->fs_type, "rw") ||
-                           !strcmp(dt->fs_type, "ro"))
-                               nfstab++, dt++;
+                       if (   (strcmp(fsp->fs_type, FSTAB_RW) == 0)
+                           || (strcmp(fsp->fs_type, FSTAB_RO) == 0) ){
+                               *dt = *fsp;
+                               nfstab++; 
+                               dt++;
+                       }
                }
                }
-               fclose(fstabfile);
+               endfsent();
        }
 }
 
        }
 }