]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
vfsck: Fix roken fallout
authorAndrew Deason <adeason@sinenomine.net>
Wed, 13 Apr 2011 17:15:12 +0000 (12:15 -0500)
committerDerrick Brashear <shadow@dementia.org>
Fri, 15 Apr 2011 17:11:15 +0000 (10:11 -0700)
Including roken.h in vfsck sources pulls in some more modern headers
that vfsck code isn't used to. Accommodate:

 - Prevent roken.h from pulling in dirent.h so we don't conflict with
   the old-style directory defines for HP-UX. Also move the inclusion
   of the old-style directory defines to before roken.h, so we have
   the directory types defined in roken.h.

 - Remove some prototypes so the don't conflict with the prototypes in
   system headers.

 - Remove a couple of bizarre vprintf invocations, as they conflict
   with the actual vprintf definitions.

Change-Id: Ifd7cd2544e75ed49b93ab491c4acadcb18528315
Reviewed-on: http://gerrit.openafs.org/4472
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/vfsck/dir.c
src/vfsck/inode.c
src/vfsck/main.c
src/vfsck/pass2.c
src/vfsck/pass3.c
src/vfsck/pass4.c
src/vfsck/setup.c
src/vfsck/utilities.c
src/vfsck/vprintf.c

index de56cf8a7b5dc12774eb9e9a9ae7bc3b6d9c967b..fb657445c1553697342058d6f266abf9c8a2171d 100644 (file)
 #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>
+# 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>
 
 #else /* AFS_VFSINCL_ENV */
 #include <sys/inode.h>
-#ifdef AFS_HPUX_ENV
-#define        LONGFILENAMES   1
-#include <sys/sysmacros.h>
-#include <sys/ino.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
 #define KERNEL
 #include <sys/dir.h>
 #undef KERNEL
index 6e74b195f6eb5a2bb132b70baf0a55d6a9528325..576695bd6e5660150808b1bb4a8b0fe8479514bb 100644 (file)
 #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>
+# 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>
 #endif
 #else /* AFS_VFSINCL_ENV */
 #include <sys/inode.h>
-#ifdef AFS_HPUX_ENV
-#define        LONGFILENAMES   1
-#include <sys/sysmacros.h>
-#include <sys/ino.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>
index 130abeb3f5e06e3e758e477b2a8e5c9b04d1c158..ad14eeed98397bab46df119d1e6bb4b70dad93c3 100644 (file)
 #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>
+# 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>
 #else /* AFS_VFSINCL_ENV */
 
 #include <sys/inode.h>
-#ifdef AFS_HPUX_ENV
-#define        LONGFILENAMES   1
-#include <sys/sysmacros.h>
-#include <sys/ino.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
 #define KERNEL
 #include <sys/dir.h>
 #undef KERNEL
 #include "fsck.h"
 #include <sys/signal.h>
 
-char *rawname(), *unrawname(), *blockcheck(), *malloc();
+char *rawname(), *unrawname(), *blockcheck();
 void catch(), catchquit(), voidquit();
 static int tryForce;
 int returntosingle;
index 402fa9c1c9b13599cf38f2eaff1f2505409860a9..472915aa972bab2014ffedb432302d88db8ed67c 100644 (file)
 #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>
+# 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>
 #endif
 #else /* AFS_VFSINCL_ENV */
 #include <sys/inode.h>
-#ifdef AFS_HPUX_ENV
-#define        LONGFILENAMES   1
-#include <sys/sysmacros.h>
-#include <sys/ino.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>
index 92a9513c2ba6c6f3be94f275d3f69dc66391b83b..655deb40e8eff0858ec1674b4ef7dbc80b313e1b 100644 (file)
@@ -88,11 +88,7 @@ pass3()
                || ((statemap[dp->di_contin] & STATE) != CSTATE)) {
                /*  this is an error which must be cleared by hand. */
                pfatal("BAD CONTINUATION INODE NUMBER ");
-#ifdef VICE
-               vprintf(" I=%u ", inumber);
-#else
                printf(" I=%u ", inumber);
-#endif /* VICE */
                if (reply("CLEAR") == 1) {
                    dp->di_contin = 0;
                    inodirty();
index f4edf818a047b364c0d760da25cd7a7709b109ce..fd7d51962d72aec5322078fe53cc21881c545381 100644 (file)
@@ -141,11 +141,7 @@ pass4()
                    pwarn("I=%u (%ld should be %ld)", inumber, dp->di_nlink,
                          1);
                    if (preen)
-#ifdef VICE
-                       vprintf(" (CORRECTED)\n");
-#else
                        printf(" (CORRECTED)\n");
-#endif /* VICE */
                    else {
                        if (reply("CORRECT") == 0)
                            continue;
index 49cbd5c60c31313388e84ac86ec3b9207150dc8d..0039074bfed13005901977fa9f1fb6d285de58e5 100644 (file)
@@ -100,7 +100,6 @@ struct bufarea *pbp;
     /* inode map */    howmany((fs)->fs_ipg, NBBY) + \
     /* block map */    howmany((fs)->fs_cpg * (fs)->fs_spc / NSPF(fs), NBBY))
 
-char *malloc(), *calloc();
 struct disklabel *getdisklabel();
 
 setup(dev)
index 67f7cd40837f6623b17662d793cf3f9f40e67ed5..353f5325bfa7999313030d44f8e3f324b70dd566 100644 (file)
 #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>
 #endif
 #else /* AFS_VFSINCL_ENV */
 #include <sys/inode.h>
-#ifdef AFS_HPUX_ENV
-#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>
@@ -81,7 +87,6 @@ long diskreads, totalreads;   /* Disk cache statistics */
 #if    !defined(AFS_HPUX101_ENV)
 long lseek();
 #endif
-char *malloc();
 #if    defined(AFS_SUN_ENV)
 extern int iscorrupt;
 #endif
index b2667367e7d0cc6169764219197e5c57469e532a..f339f09e961515579381657c060d9cfe135a40d0 100644 (file)
 #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>
+# 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>
 #else /* AFS_VFSINCL_ENV */
 
 #include <sys/inode.h>
-#ifdef AFS_HPUX_ENV
-#define        LONGFILENAMES   1
-#include <sys/sysmacros.h>
-#include <sys/ino.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
 #define KERNEL
 #include <sys/dir.h>
 #undef KERNEL