Remove DUX/OSF code
[openafs.git] / src / vfsck / pass1.c
index 7615cd7..262abad 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
+#include <roken.h>
+
+#include <ctype.h>
 
 #define VICE
-#include <sys/param.h>
-#include <sys/time.h>
-#ifdef AFS_OSF_ENV
-#include <sys/vnode.h>
-#include <sys/mount.h>
-#include <ufs/inode.h>
-#include <ufs/fs.h>
-#define        _BSD
-#define        _KERNEL
-#include <ufs/dir.h>
-#undef _KERNEL
-#undef _BSD
-#include <stdio.h>
-#else /* AFS_OSF_ENV */
 #ifdef AFS_VFSINCL_ENV
 #include <sys/vnode.h>
 #ifdef   AFS_SUN5_ENV
-#include <stdio.h>
-#include <unistd.h>
 #include <sys/fs/ufs_inode.h>
 #include <sys/fs/ufs_fs.h>
 #define _KERNEL
 #ifdef AFS_HPUX_ENV
 extern int ge_danger;
 #define        DUX
-#include <ctype.h>
 #define        LONGFILENAMES   1
 #include <sys/sysmacros.h>
 #include <sys/ino.h>
 #endif
 #include <sys/fs.h>
 #endif /* AFS_VFSINCL_ENV */
-#endif /* AFS_OSF_ENV */
 
 #include <afs/osi_inode.h>
 #include "fsck.h"
@@ -140,9 +125,9 @@ pass1()
            }
            lastino = inumber;
 #if defined(ACLS) && defined(AFS_HPUX_ENV)
-           /* 
-            * Don't check blocks and sizes of  
-            * continuation inodes 
+           /*
+            * Don't check blocks and sizes of
+            * continuation inodes
             */
            if (CONT) {
                statemap[inumber] = CSTATE;
@@ -151,7 +136,7 @@ pass1()
                continue;
            }
 #endif /* ACLS */
-#if    defined(AFS_SUN56_ENV)
+#if    defined(AFS_SUN5_ENV)
            if (dp->di_size < 0 || dp->di_size > (UOFF_T) UFS_MAXOFFSET_T) {
                if (debug)
                    printf("bad size %llu:", dp->di_size);
@@ -239,7 +224,7 @@ pass1()
 
            if (ndb < 0) {
                if (debug)
-#if    defined(AFS_SUN56_ENV)
+#if    defined(AFS_SUN5_ENV)
                    printf("bad size %" AFS_INT64_FMT " ndb %d:",
 #else
                    printf("bad size %d ndb %d:",
@@ -250,14 +235,11 @@ pass1()
            if ((dp->di_mode & IFMT) == IFBLK
                || (dp->di_mode & IFMT) == IFCHR)
                ndb++;
-#ifdef AFS_OSF_ENV
-           if ((dp->di_flags & IC_FASTLINK) == 0) {
-#endif /* AFS_OSF_ENV */
                for (j = ndb; j < NDADDR; j++) {
 #if defined(AFS_HPUX_ENV) && (defined(DUX) || defined(CNODE_DEV))
-                   /*  
+                   /*
                     * DUX uses db[2] on cnode-specific
-                    * device files, so skip 'em 
+                    * device files, so skip 'em
                     */
                    if (j == 2 && SPECIAL)
                        continue;
@@ -287,15 +269,12 @@ pass1()
 #if    defined(AFS_HPUX_ENV)
              ignore_direct_block_check:
 #endif
-#ifdef AFS_OSF_ENV
-           }
-#endif /* AFS_OSF_ENV */
            if (ftypeok(dp) == 0)
                goto unknown;
            n_files++;
            lncntp[inumber] = dp->di_nlink;
            if (dp->di_nlink <= 0) {
-               zlnp = (struct zlncnt *)malloc(sizeof *zlnp);
+               zlnp = malloc(sizeof *zlnp);
                if (zlnp == NULL) {
                    pfatal("LINK COUNT TABLE OVERFLOW");
                    if (reply("CONTINUE") == 0)
@@ -306,7 +285,7 @@ pass1()
                    zlnhead = zlnp;
                }
            }
-#if    defined(AFS_SUN56_ENV)
+#if    defined(AFS_SUN5_ENV)
            if (OLDVICEINODE) {
                if (yflag) {
                    if (!oldreported) {
@@ -335,8 +314,8 @@ pass1()
                (dp->di_mode & IFMT) == IFDIR ? DSTATE : FSTATE;
 #endif /* VICE */
 #if defined(ACLS) && defined(AFS_HPUX_ENV)
-           /* 
-            * keep track of associated contin inodes 
+           /*
+            * keep track of associated contin inodes
             */
            if (dp->di_contin != 0)
                statemap[inumber] |= HASCINODE;
@@ -436,7 +415,7 @@ pass1check(idesc)
 #endif
                return (STOP);
            }
-           new = (struct dups *)malloc(sizeof(struct dups));
+           new = malloc(sizeof(struct dups));
            if (new == NULL) {
                pfatal("DUP TABLE OVERFLOW.");
                if (reply("CONTINUE") == 0)