venus: Tidy up header includes
[openafs.git] / src / venus / up.c
index 7820755..522dc08 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright 2000, International Business Machines Corporation and others.
  * All Rights Reserved.
- * 
+ *
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
 #include <afsconfig.h>
 #include <afs/param.h>
 
+#include <roken.h>
 
-/* missing type from C language */
-
-#include <errno.h>
-#ifdef AFS_AIX32_ENV
-#include <signal.h>
-#undef _NONSTD_TYPES
-#endif
-#include <stdio.h>
-#include <unistd.h>
 #include <afs/afs_args.h>
-#include <sys/param.h>
-#ifdef AFS_SUN5_ENV
-#include <fcntl.h>
-#endif
-#include <sys/file.h>
-#include <sys/stat.h>
-#include <dirent.h>
-#include <sys/time.h>
 #define VIRTUE
 #define VICE
-#include <sys/ioctl.h>
 #include <afs/vice.h>
 #undef VIRTUE
 #undef VICE
-#include <sys/ioctl.h>
-#include <netdb.h>
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-
-#include <string.h>
-#include <stdlib.h>
-
 #include <afs/venus.h>
 #include <afs/sys_prototypes.h>
 #include <afs/afsutil.h>
@@ -92,8 +66,8 @@ main(int argc, char *argv[])
 {
 #ifdef AFS_AIX32_ENV
     /*
-     * The following signal action for AIX is necessary so that in case of a 
-     * crash (i.e. core is generated) we can include the user's data section 
+     * The following signal action for AIX is necessary so that in case of a
+     * crash (i.e. core is generated) we can include the user's data section
      * in the core dump. Unfortunately, by default, only a partial core is
      * generated which, in many cases, isn't too useful.
      */
@@ -125,6 +99,10 @@ ScanArgs(int argc, char *argv[])
     while (argc > 0 && *argv[0] == '-') {
        char *cp = *argv;
 
+       if (strlen(cp) > 2) {
+           goto badoption;
+       }
+
        switch (*++cp) {
        case 'v':
            verbose = 1;
@@ -151,7 +129,10 @@ ScanArgs(int argc, char *argv[])
            break;
 
        default:
-           fprintf(stderr, "Unknown option: '%c'\n", *cp);
+           cp--;
+
+ badoption:
+           fprintf(stderr, "Unknown option: '%s'\n", cp);
            fprintf(stderr, USAGE);
            exit(1);
        }
@@ -353,7 +334,7 @@ Copy(char *file1, char *file2, short recursive, int level)
            if (s1.st_size != s2.st_size) {
                fprintf(stderr,
                        "WARNING: New file %s is %u bytes long; should be %u\n",
-                       file2, (unsigned int) s2.st_size, 
+                       file2, (unsigned int) s2.st_size,
                        (unsigned int) s1.st_size);
            }
        }
@@ -771,5 +752,4 @@ isMountPoint(char *name, struct ViceIoctl *blob)
             */
        }
     }
-    return 4;
 }