#include <afsconfig.h>
#include <afs/param.h>
+#ifdef AFS_HPUX_ENV
+/* We need the old directory type headers (included below), so don't include
+ * the normal dirent.h, or it will conflict. */
+# undef HAVE_DIRENT_H
+# include <sys/inode.h>
+# define LONGFILENAMES 1
+# include <sys/sysmacros.h>
+# include <sys/ino.h>
+# include <sys/signal.h>
+# define DIRSIZ_MACRO
+# ifdef HAVE_USR_OLD_USR_INCLUDE_NDIR_H
+# include </usr/old/usr/include/ndir.h>
+# else
+# include <ndir.h>
+# endif
+#endif
+
+#include <roken.h>
+
+#include <ctype.h>
-#include <sys/param.h>
#define VICE /* allow us to put our changes in at will */
-#include <sys/time.h>
#ifdef AFS_OSF_ENV
#include <sys/vnode.h>
#include <sys/mount.h>
#ifdef AFS_VFSINCL_ENV
#include <sys/vnode.h>
#ifdef AFS_SUN5_ENV
-#include <stdio.h>
-#include <unistd.h>
-#include <signal.h>
#include <sys/fs/ufs_inode.h>
#include <sys/fs/ufs_fs.h>
#define _KERNEL
#endif
#else /* AFS_VFSINCL_ENV */
#include <sys/inode.h>
-#ifdef AFS_HPUX_ENV
-#include <ctype.h>
-#define LONGFILENAMES 1
-#include <sys/sysmacros.h>
-#include <sys/ino.h>
-#include <sys/signal.h>
-#define DIRSIZ_MACRO
-#ifdef HAVE_USR_OLD_USR_INCLUDE_NDIR_H
-#include </usr/old/usr/include/ndir.h>
-#else
-#include <ndir.h>
-#endif
-#else
+#ifndef AFS_HPUX_ENV
#include <sys/dir.h>
#endif
#include <sys/fs.h>
#endif /* AFS_VFSINCL_ENV */
#endif /* AFS_OSF_ENV */
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
#include "fsck.h"
-#if defined(AFS_HPUX101_ENV)
-#include <unistd.h>
-#endif
-
#if defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV)
#define AFS_NEWCG_ENV
#else
#if !defined(AFS_HPUX101_ENV)
long lseek();
#endif
-char *malloc();
#if defined(AFS_SUN_ENV)
extern int iscorrupt;
#endif
#ifdef AFS_SUN5_ENV
#include <sys/mntent.h>
#include <sys/mnttab.h>
-#include <sys/stat.h>
#include <sys/vfstab.h>
offset_t llseek();
printf("\n");
if (!persevere && (nflag || fswritefd < 0)) {
printf("%s? no\n\n", question);
-#if defined(AFS_SUN_ENV)
+#if defined(AFS_SUN_ENV)
iscorrupt = 1; /* known to be corrupt */
#endif
return (0);
fsbtodb(&sblock, sblock.fs_csaddr));
}
#else
-#if defined(AFS_SUN56_ENV)
+#if defined(AFS_SUN5_ENV)
sip = (caddr_t) sblock.fs_u.fs_csp;
for (i = 0, j = 0; i < sblock.fs_cssize; i += sblock.fs_bsize, j++) {
size =
sblock.fs_cssize - i <
sblock.fs_bsize ? sblock.fs_cssize - i : sblock.fs_bsize);
}
-#endif /* AFS_SUN56_ENV */
+#endif /* AFS_SUN5_ENV */
#endif /* AFS_HPUX101_ENV */
}
flush(fswritefd, bp);
nbp = bp->b_prev;
free(bp->b_un.b_buf);
- free((char *)bp);
+ free(bp);
}
#ifdef AFS_SUN5_ENVX
pbp = pdirbp = NULL;
unsigned int size;
unsigned int bno;
unsigned int fsclean;
-#if defined(AFS_SUN56_ENV)
+#if defined(AFS_SUN5_ENV)
offset_t sblkoff;
#endif
/* read private copy of superblock, update clean flag, and write it */
bno = sblk.b_bno;
size = sblk.b_size;
-#if defined(AFS_SUN56_ENV)
+#if defined(AFS_SUN5_ENV)
sblkoff = (OFF_T) (bno) << DEV_BSHIFT;
if (llseek(fsreadfd, sblkoff, 0) == -1)
return;
fs_set_state(cleanbuf.b_un.b_fs, fs_get_state(&sblock));
#endif
cleanbuf.b_un.b_fs->fs_time = sblock.fs_time;
-#if defined(AFS_SUN56_ENV)
+#if defined(AFS_SUN5_ENV)
if (llseek(fswritefd, sblkoff, 0) == -1)
return;
#else
}
#endif
-#ifdef AFS_SUN52_ENV
+#ifdef AFS_SUN5_ENV
char *
hasvfsopt(vfs, opt)
struct vfstab *vfs;
if (vfs->vfs_mntopts == NULL)
return (NULL);
if (tmpopts == 0) {
- tmpopts = (char *)calloc(256, sizeof(char));
+ tmpopts = calloc(256, sizeof(char));
if (tmpopts == 0)
return (0);
}
#if defined(AFS_HPUX101_ENV)
#include "libfs.h"
-#include <sys/stat.h>
#include <sys/fcntl.h>
int seek_options;