Clean up warnings in the tests directory
authorRuss Allbery <rra@stanford.edu>
Fri, 28 May 2010 16:03:50 +0000 (11:03 -0500)
committerDerrick Brashear <shadow@dementia.org>
Sun, 30 May 2010 04:47:41 +0000 (21:47 -0700)
Build repair.o with strict aliasing disabled because it addresses the
same data structure via two different structs at the same time.  Fix
various other, more minor warnings.

Several fixes here require more Autoconf glue to work properly, but
that's deferred to future work (such as some HAVE_* defines that we
don't probe for and the handling of non-native 64-bit integers in
some of the code).

Change-Id: I721a9fb952d2cf485d2df8e5672e5e5f5d9d6159
Reviewed-on: http://gerrit.openafs.org/2060
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

31 files changed:
src/tests/.gitignore
src/tests/Makefile.in
src/tests/afscp.c
src/tests/afsdump_dirlist.c
src/tests/afsdump_extract.c
src/tests/asu.c
src/tests/backuphdr.c
src/tests/create-stat.c
src/tests/dumptool.c
src/tests/dup2-and-unlog.c
src/tests/fs_lib.c
src/tests/fs_lib.h [new file with mode: 0644]
src/tests/fsx.c
src/tests/hardlink2.c
src/tests/large-dir2.c
src/tests/make-page.c
src/tests/mmap-cat.c
src/tests/mmap-vs-read.c
src/tests/pine.c
src/tests/rename6.c
src/tests/rm-rf.c
src/tests/snprintf.c
src/tests/stagehdr.c
src/tests/test-parallel1.c
src/tests/test-setgroups.c
src/tests/test-setpag.c
src/tests/utime-file.c
src/tests/write-closed2.c
src/tests/write-large.c
src/tests/write-rand.c
src/tests/xf_rxcall.c

index 3ac53c8..140a4ff 100644 (file)
@@ -6,6 +6,7 @@
 /xf_errs.h
 /OS.pm
 /Dirpath.pm
+/afscp
 /afsdump_dirlist
 /afsdump_extract
 /afsdump_scan
@@ -54,6 +55,7 @@
 /rename6
 /rm-rf
 /run-tests
+/run-tests.conf
 /still-there-p
 /strange-characters-c
 /symlink
index 4504943..2e141a6 100644 (file)
@@ -40,6 +40,10 @@ OBJS_libdumpscan.a   = primitive.o util.o dumpscan_errs.o parsetag.o \
 TARGETS = libxfiles.a libdumpscan.a \
           afsdump_scan afsdump_dirlist afsdump_extract dumptool
 
+all: run-tests OpenAFS/Dirpath.pm libxfiles.a libdumpscan.a $(TEST_PROGRAMS)\
+       afsdump_scan afsdump_dirlist afsdump_extract dumptool OpenAFS/Dirpath.sh
+       @chmod +x run-tests
+
 afsdump_scan: libxfiles.a libdumpscan.a $(OBJS_afsdump_scan)
        $(CC) $(CFLAGS) $(LDFLAGS) -o afsdump_scan $(OBJS_afsdump_scan) $(LIBS)
 
@@ -76,8 +80,13 @@ dumpscan_errs.c dumpscan_errs.h: dumpscan_errs.et
 
 util.o xfiles.o xf_files.o: xf_errs.h
 backuphdr.o directory.o parsedump.o parsetag.o: dumpscan_errs.h
-parsevnode.o parsevol.o pathname.o repair.o:    dumpscan_errs.h
-stagehdr.o util.o:                              dumpscan_errs.h
+parsevnode.o parsevol.o pathname.o stagehdr.o:  dumpscan_errs.h
+util.o:                                         dumpscan_errs.h
+
+# repair addresses the same storage as two different types of structs at the
+# same time.
+repair.o: repair.c dumpscan_errs.h
+       $(CCOBJ) $(CFLAGS) @CFLAGS_NOSTRICT@ -c ${srcdir}/repair.c
 
 ${TOP_LIBDIR}/libxfiles.a: libxfiles.a
        ${INSTALL_DATA} $? $@
@@ -339,10 +348,6 @@ install:
 
 uninstall:
 
-all: run-tests OpenAFS/Dirpath.pm libxfiles.a libdumpscan.a $(TEST_PROGRAMS)\
-       afsdump_scan afsdump_dirlist afsdump_extract dumptool OpenAFS/Dirpath.sh
-       @chmod +x run-tests
-
 clean:
        -rm -f xf_errs.c xf_errs.h dumpscan_errs.c dumpscan_errs.h *.o \
        $(TARGETS) run-tests $(TEST_PROGRAMS) OpenAFS/Dirpath.pm OpenAFS/Dirpath.sh
index da858d5..0cbeba4 100644 (file)
@@ -585,7 +585,7 @@ Finish:
        double rate, size, time;
        if (finish.tv_sec == start.tv_sec) {
            printf("Copied %d bytes in %d microseconds\n", filesz,
-                  finish.tv_usec - start.tv_usec);
+                  (int)(finish.tv_usec - start.tv_usec));
        } else {
            printf("Copied %d bytes in %d seconds\n", filesz,
                   (int)(finish.tv_sec - start.tv_sec));
index 3dced00..4933c00 100644 (file)
 
 /* afsdump_dirlist.c - List an AFS directory file */
 
+#include <afsconfig.h>
+
 #include <sys/fcntl.h>
 #include <stdlib.h>
 #include <stdarg.h>
 #include <string.h>
 
+#include <afs/stds.h>
+#include <afs/com_err.h>
+#include <afs/cellconfig.h>
+#include <afs/vlserver.h>
+#include <afs/volser.h>
+#include <rx/rxkad.h>
+
 #include "dumpscan.h"
+#include "dumpscan_errs.h"
+#include "xf_errs.h"
 
 extern int optind;
 extern char *optarg;
@@ -42,7 +53,6 @@ char *argv0;
 static char *input_path;
 static int quiet, verbose, error_count;
 
-static path_hashinfo phi;
 static dump_parser dp;
 
 
@@ -67,7 +77,7 @@ parse_options(int argc, char **argv)
     int c;
 
     /* Set the program name */
-    if (argv0 = strrchr(argv[0], '/'))
+    if ((argv0 = strrchr(argv[0], '/')) != NULL)
        argv0++;
     else
        argv0 = argv[0];
@@ -117,11 +127,12 @@ my_error_cb(afs_uint32 code, int fatal, void *ref, char *msg, ...)
        afs_com_err_va(argv0, code, msg, alist);
        va_end(alist);
     }
+    return 0;
 }
 
 
 /* Main program */
-void
+int
 main(int argc, char **argv)
 {
     XFILE input_file;
@@ -154,5 +165,5 @@ main(int argc, char **argv)
        fprintf(stderr, "*** %d errors\n", error_count);
     if (r && !quiet)
        fprintf(stderr, "*** FAILED: %s\n", afs_error_message(r));
-    exit(0);
+    return 0;
 }
index b1ecbb9..122c968 100644 (file)
 #include <string.h>
 
 #include <afs/com_err.h>
+#include <afs/cellconfig.h>
+#include <afs/vlserver.h>
+#include <afs/volser.h>
+#include <rx/rxkad.h>
+
 #include "dumpscan.h"
 #include "dumpscan_errs.h"
 #include "xf_errs.h"
index ec300b3..fc3c21e 100644 (file)
@@ -41,7 +41,7 @@
 #include <stdio.h>
 #include <pwd.h>
 #include <unistd.h>
-
+#include <grp.h>
 
 #include <err.h>
 
index 3eb5db2..e42cfff 100644 (file)
@@ -93,6 +93,10 @@ PrintBackupHdr(backup_system_header * hdr)
     printf("          => %s", ctime(&to));
     printf(" Dump Time:  %d == %s", hdr->dump_date, ctime(&dd));
     printf(" Dump Flags: 0x%08x\n", hdr->flags);
-    printf(" Length:     %d\n", hdr->dumplen);
+#ifdef NATIVE_INT64
+    printf(" Length:     %llu\n", hdr->dumplen);
+#else
+    printf(" Length:     %u,%u\n", hdr->dumplen.hi, hdr->dumplen.lo);
+#endif
     printf(" File Num:   %d\n", hdr->filenum);
 }
index 3f09fa2..1625b02 100644 (file)
@@ -35,6 +35,8 @@
 #include <config.h>
 #endif
 
+#include <afsconfig.h>
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <afs/cmd.h>
 
 #include <err.h>
-
-struct VenusFid {
-    afs_int32 Cell;
-    struct AFSFid Fid;
-};
+#include <fs_lib.h>
 
 static void
 usage(int ret)
index fee670e..affa5f9 100644 (file)
@@ -279,7 +279,6 @@ int ShutdownInProgress = 0;
 static int ReadDumpHeader(FILE *, struct DumpHeader *);
 static int ReadVolumeHeader(FILE *, VolumeDiskData *);
 static int ScanVnodes(FILE *, VolumeDiskData *, int);
-static int DumpVnodeFile(FILE *, struct VnodeDiskObject *, VolumeDiskData *);
 static struct vnodeData *InsertVnode(unsigned int, struct VnodeDiskObject *);
 static struct vnodeData *GetVnode(unsigned int);
 static int CompareVnode(const void *, const void *);
@@ -292,7 +291,6 @@ static struct vnodeData *ChangeDirectory(int, char **, struct vnodeData *);
 static void CopyFile(int, char **, struct vnodeData *, FILE *);
 static void CopyVnode(int, char **, FILE *);
 static void DumpAllFiles(int, char **, struct vnodeData *, VolumeDiskData *);
-static void DumpAllResidencies(FILE *, struct vnodeData *, VolumeDiskData *);
 static struct vnodeData *FindFile(struct vnodeData *, char *);
 static void ResetDirCursor(struct DirCursor *, struct vnodeData *);
 static struct DirEntry *ReadNextDir(struct DirCursor *, struct vnodeData *);
@@ -303,15 +301,23 @@ static int ReadInt32(FILE *, uint32_t *);
 static int ReadString(FILE *, char *, int);
 static int ReadByteString(FILE *, void *, int);
 
+#ifdef RESIDENCY
+static int DumpVnodeFile(FILE *, struct VnodeDiskObject *, VolumeDiskData *);
+static void DumpAllResidencies(FILE *, struct vnodeData *, VolumeDiskData *);
+#endif
+
 int
 main(int argc, char *argv[])
 {
-    int c, errflg = 0, dumpvnodes = 0, force = 0, inode = 0;
+    int c, errflg = 0, force = 0, inode = 0;
     unsigned int magic;
     struct DumpHeader dheader;
     VolumeDiskData vol;
     off64_t offset;
+#ifdef RESIDENCY
     int Res, Arg1, Arg2, Arg3, i;
+    int dumpvnodes = 0;
+#endif
     char *p;
     struct winsize win;
     FILE *f;
@@ -460,8 +466,8 @@ main(int argc, char *argv[])
     }
 
     if (verbose)
-       printf("Dump is for volume %lu (%s)\n", dheader.volumeId,
-              dheader.volumeName);
+       printf("Dump is for volume %lu (%s)\n",
+              (unsigned long) dheader.volumeId, dheader.volumeName);
 
     if (getc(f) != D_VOLUMEHEADER) {
        fprintf(stderr, "Volume header is missing from dump, aborting\n");
@@ -475,8 +481,8 @@ main(int argc, char *argv[])
 
     if (verbose) {
        printf("Volume information:\n");
-       printf("\tid = %lu\n", vol.id);
-       printf("\tparent id = %lu\n", vol.parentId);
+       printf("\tid = %lu\n", (unsigned long) vol.id);
+       printf("\tparent id = %lu\n", (unsigned long) vol.parentId);
        printf("\tname = %s\n", vol.name);
        printf("\tflags =");
        if (vol.inUse)
@@ -488,14 +494,14 @@ main(int argc, char *argv[])
        if (vol.needsSalvaged)
            printf(" needsSalvaged");
        printf("\n");
-       printf("\tuniquifier = %lu\n", vol.uniquifier);
+       printf("\tuniquifier = %lu\n", (unsigned long) vol.uniquifier);
        tmv = vol.creationDate;
        printf("\tCreation date = %s", ctime(&tmv));
        tmv = vol.accessDate;
        printf("\tLast access date = %s", ctime(&tmv));
        tmv = vol.updateDate;
        printf("\tLast update date = %s", ctime(&tmv));
-       printf("\tVolume owner = %lu\n", vol.owner);
+       printf("\tVolume owner = %lu\n", (unsigned long) vol.owner);
     }
 
     if (verbose)
@@ -1409,7 +1415,7 @@ DirListInternal(struct vnodeData *vdata, char *pathnames[], int numpathnames,
                        c = '/';
                    else if (lvdata->vnode->type == vSymlink)
                        c = '@';
-                   else if (lvdata->vnode->modeBits & 0111 != 0)
+                   else if ((lvdata->vnode->modeBits & 0111) != 0)
                        c = '*';
                    else
                        c = ' ';
@@ -1898,7 +1904,7 @@ FindFile(struct vnodeData *vdatacwd, char *filename)
     }
 
     if ((vdata = GetVnode(ntohl(ep->fid.vnode))) == NULL) {
-       fprintf(stderr, "%s: No vnode information for %lu found\n", filename,
+       fprintf(stderr, "%s: No vnode information for %u found\n", filename,
                ntohl(ep->fid.vnode));
        return NULL;
     }
@@ -1972,7 +1978,7 @@ MakeArgv(char *string, int *argc, char ***argv)
     *argc = 0;
     *argv = largv;
 
-    while (*la++ = GetToken(s, &s, ap, &ap))
+    while ((*la++ = GetToken(s, &s, ap, &ap)) != NULL)
        (*argc)++;
 }
 
@@ -2409,15 +2415,15 @@ ReadByteString(FILE * f, void *s, int size)
  * The directory hashing algorithm used by AFS
  */
 
-DirHash(string)
-     register char *string;
+int
+DirHash(char *string)
 {
     /* Hash a string to a number between 0 and NHASHENT. */
     register unsigned char tc;
     register int hval;
     register int tval;
     hval = 0;
-    while (tc = (*string++)) {
+    while ((tc = (*string++)) != '\0') {
        hval *= 173;
        hval += tc;
     }
index a03e455..c3e05c5 100644 (file)
@@ -8,6 +8,9 @@
 #include <unistd.h>
 #include <err.h>
 
+#include <afs/stds.h>
+#include <afs/auth.h>
+
 int
 main(int argc, char **argv)
 {
index 8361729..1a068c0 100644 (file)
 #include <afs/afsint.h>
 #include <afs/cellconfig.h>
 #include <afs/cmd.h>
+#include <afs/sys_prototypes.h>
 
-enum { PIOCTL_MAXSIZE = 2000 };
+#include <err.h>
+#include <fs_lib.h>
 
-struct VenusFid {
-    afs_int32 Cell;
-    struct AFSFid Fid;
-};
+enum { PIOCTL_MAXSIZE = 2000 };
 
 /*
  * fs_getfid, the the `fid' that `path' points on. 
@@ -431,6 +430,8 @@ fs_invalidate(const char *path)
  * outflags == NULL -> don't return
  */
 
+#if defined(VIOC_XFSDEBUG) || defined(VIOC_XFSDEBUG_PRINT) \
+    || defined(VIOC_ARLADEBUG)
 static int
 debug(int pioctl_cmd, int inflags, int *outflags, char *pathname)
 {
@@ -463,6 +464,7 @@ debug(int pioctl_cmd, int inflags, int *outflags, char *pathname)
 
     return 0;
 }
+#endif
 
 /*
  * xfs_debug
diff --git a/src/tests/fs_lib.h b/src/tests/fs_lib.h
new file mode 100644 (file)
index 0000000..deef8b5
--- /dev/null
@@ -0,0 +1,17 @@
+/* Prototypes for fs_lib.c. */
+
+#ifndef FS_LIB_H
+#define FS_LIB_H 1
+
+#include <afs/stds.h>
+#include <afs/afsint.h>
+
+struct VenusFid {
+    afs_int32 Cell;
+    struct AFSFid Fid;
+};
+
+int fs_getfid(char *, struct VenusFid *);
+int fs_rmmount(const char *);
+
+#endif /* !FS_LIB_H */
index 44b7f30..86137ea 100644 (file)
@@ -393,9 +393,10 @@ doread(unsigned offset, unsigned size)
        return;
 
     if (!quiet
-       && (progressinterval && testcalls % progressinterval == 0 || debug
-           && (monitorstart == -1 || offset + size > monitorstart
-               && (monitorend == -1 || offset <= monitorend))))
+       && ((progressinterval && testcalls % progressinterval == 0)
+            || (debug
+                && (monitorstart == -1 || offset + size > monitorstart)
+                && (monitorend == -1 || offset <= monitorend))))
        prt("%lu read\t0x%x thru\t0x%x\t(0x%x bytes)\n", testcalls, offset,
            offset + size - 1, size);
     ret = lseek(fd, (off_t) offset, SEEK_SET);
@@ -442,9 +443,10 @@ domapread(unsigned offset, unsigned size)
        return;
 
     if (!quiet
-       && (progressinterval && testcalls % progressinterval == 0 || debug
-           && (monitorstart == -1 || offset + size > monitorstart
-               && (monitorend == -1 || offset <= monitorend))))
+       && ((progressinterval && testcalls % progressinterval == 0)
+            || (debug
+                && (monitorstart == -1 || offset + size > monitorstart)
+                && (monitorend == -1 || offset <= monitorend))))
        prt("%lu mapread\t0x%x thru\t0x%x\t(0x%x bytes)\n", testcalls, offset,
            offset + size - 1, size);
 
@@ -510,9 +512,10 @@ dowrite(unsigned offset, unsigned size)
        return;
 
     if (!quiet
-       && (progressinterval && testcalls % progressinterval == 0 || debug
-           && (monitorstart == -1 || offset + size > monitorstart
-               && (monitorend == -1 || offset <= monitorend))))
+       && ((progressinterval && testcalls % progressinterval == 0)
+            || (debug
+                && (monitorstart == -1 || offset + size > monitorstart)
+                && (monitorend == -1 || offset <= monitorend))))
        prt("%lu write\t0x%x thru\t0x%x\t(0x%x bytes)\n", testcalls, offset,
            offset + size - 1, size);
     ret = lseek(fd, (off_t) offset, SEEK_SET);
@@ -565,9 +568,10 @@ domapwrite(unsigned offset, unsigned size)
        return;
 
     if (!quiet
-       && (progressinterval && testcalls % progressinterval == 0 || debug
-           && (monitorstart == -1 || offset + size > monitorstart
-               && (monitorend == -1 || offset <= monitorend))))
+       && ((progressinterval && testcalls % progressinterval == 0)
+            || (debug
+                && (monitorstart == -1 || offset + size > monitorstart)
+                && (monitorend == -1 || offset <= monitorend))))
        prt("%lu mapwrite\t0x%x thru\t0x%x\t(0x%x bytes)\n", testcalls,
            offset, offset + size - 1, size);
 
@@ -620,8 +624,9 @@ dotruncate(unsigned size)
     if (testcalls <= simulatedopcount)
        return;
 
-    if (progressinterval && testcalls % progressinterval == 0 || debug
-       && (monitorstart == -1 || monitorend == -1 || size <= monitorend))
+    if ((progressinterval && testcalls % progressinterval == 0)
+        || (debug
+            && (monitorstart == -1 || monitorend == -1 || size <= monitorend)))
        prt("%lu trunc\tfrom 0x%x to 0x%x\n", testcalls, oldsize, size);
     if (ftruncate(fd, (off_t) size) == -1) {
        prt("ftruncate1: %x\n", size);
@@ -632,7 +637,7 @@ dotruncate(unsigned size)
 
 
 void
-writefileimage()
+writefileimage(void)
 {
     ssize_t iret;
 
@@ -749,8 +754,7 @@ test(void)
 
 
 void
-cleanup(sig)
-     int sig;
+cleanup(int sig)
 {
     if (sig)
        prt("signal %d\n", sig);
@@ -1027,7 +1031,7 @@ main(int argc, char **argv)
                warn("main: error on write");
            } else
                warn("main: short write, 0x%x bytes instead of 0x%x\n",
-                    (unsigned)written, maxfilelen);
+                    (unsigned)written, (unsigned)maxfilelen);
            exit(98);
        }
     } else
index 210d90f..e745053 100644 (file)
 int
 main(int argc, char *argv[])
 {
-    int fd1;
     int ret;
-    struct stat sb1;
-
 
     ret = mkdir("1", 0777);
     if (ret < 0)
index 0679713..891a2b9 100644 (file)
@@ -43,6 +43,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <dirent.h>
+#include <time.h>
 
 #include <err.h>
 
index 475efee..2a0d896 100644 (file)
@@ -46,6 +46,7 @@
 #include <sys/time.h>
 #include <unistd.h>
 #include <fcntl.h>
+#include <time.h>
 
 #include <err.h>
 
index efea131..153e7f8 100644 (file)
@@ -105,7 +105,6 @@ doit(const char *filename, void (*func) (int, struct stat *))
 
 static int read_flag;
 static int mmap_flag;
-static int help_flag;
 
 static void
 usage(int exit_val)
@@ -117,8 +116,6 @@ usage(int exit_val)
 int
 main(int argc, char **argv)
 {
-    int optind = 0;
-
     if (argc != 2)
        usage(1);
 
index e4879b3..0d87502 100644 (file)
@@ -133,7 +133,7 @@ do_test(int randomp)
        err(1, "open %s", file);
 
     mmap_buf = mmap_file(fd, sz);
-    malloc_buf = read_file(fd, sz);
+    malloc_buf = (unsigned char *) read_file(fd, sz);
     close(fd);
     unlink(file);
     if (memcmp(malloc_buf, mmap_buf, sz) != 0) {
index cd68611..cf66e8c 100644 (file)
@@ -41,6 +41,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/stat.h>
+#include <time.h>
 
 #include <err.h>
 
index e4bd78a..4228482 100644 (file)
@@ -55,7 +55,6 @@ main(int argc, char **argv)
 {
     int ret;
     int fd;
-    struct stat old_sb, new_sb, dot_sb;
 
     fd = open("foo", O_RDWR | O_CREAT | O_TRUNC, 0644);
     if (fd < 0)
index d5045e4..5d0d760 100644 (file)
 #include <unistd.h>
 #include <dirent.h>
 
+#include <afs/stds.h>
+
 #include <err.h>
+#include <fs_lib.h>
 
 static void
   kill_one(const char *filename);
index ed86a12..f5ce264 100644 (file)
@@ -44,6 +44,9 @@
 #ifndef HAVE_VASNPRINTF
 int vasnprintf(char **ret, size_t max_sz, const char *format, va_list args);
 #endif
+#ifndef HAVE_VASPRINTF
+int vasprintf(char**ret, const char *format, va_list args);
+#endif
 
 #ifndef min
 #define min(a, b)               ((a) > (b) ? (b) : (a))
index c5fc43e..b1d8db1 100644 (file)
@@ -99,7 +99,12 @@ ParseStageHdr(XFILE * X, unsigned char *tag, backup_system_header * hdr)
        hdr->dump_date = ntohl(bckhdr->c_time);
        hdr->filenum = ntohl(bckhdr->c_filenum);
        hdr->volid = ntohl(bckhdr->c_id);
+#ifdef NATIVE_INT64
        hdr->dumplen = ntohl(bckhdr->c_length);
+#else
+        hdr->dumplen.hi = 0;
+        hdr->dumplen.lo = ntohl(bckhdr->c_length);
+#endif
        hdr->level = ntohl(bckhdr->c_level);
        hdr->magic = ntohl(bckhdr->c_magic);
        hdr->cksum = ntohl(bckhdr->c_checksum);
@@ -145,7 +150,11 @@ DumpStageHdr(XFILE * OX, backup_system_header * hdr)
     bckhdr->c_filenum = htonl(hdr->filenum);
     bckhdr->c_time = htonl(hdr->dump_date);
     bckhdr->c_id = htonl(hdr->volid);
-    bckhdr->c_length = htonl(hdr->dumplen);
+#ifdef NATIVE_INT64
+    bckhdr->c_length = htonl((afs_uint32) hdr->dumplen);
+#else
+    bckhdr->c_length = htonl(hdr->dumplen.lo);
+#endif
     bckhdr->c_level = htonl(hdr->level);
     bckhdr->c_magic = htonl(STAGE_MAGIC);
     bckhdr->c_flags = htonl(hdr->flags);
index dd208c6..e5fc635 100644 (file)
@@ -36,6 +36,7 @@
 #endif
 
 #include <stdio.h>
+#include <sys/stat.h>
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <sys/param.h>
index 72730d7..76f012b 100644 (file)
@@ -35,6 +35,7 @@
 #include <config.h>
 #endif
 
+#include <grp.h>
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/param.h>
@@ -42,6 +43,9 @@
 #include <pwd.h>
 #include <limits.h>
 
+#include <afs/stds.h>
+#include <afs/sys_prototypes.h>
+
 #include <err.h>
 
 #if !defined(NGROUPS) && defined(NGROUPS_MAX)
index d929498..90be89c 100644 (file)
@@ -43,6 +43,9 @@
 #include <pwd.h>
 #include <limits.h>
 
+#include <afs/stds.h>
+#include <afs/sys_prototypes.h>
+
 #include <err.h>
 
 #if !defined(NGROUPS) && defined(NGROUPS_MAX)
index 2594b67..be2135e 100644 (file)
@@ -42,6 +42,7 @@
 #include <utime.h>
 #include <sys/stat.h>
 #include <sys/time.h>
+#include <time.h>
 
 #include <err.h>
 
index a812ff3..53305b4 100644 (file)
@@ -59,6 +59,7 @@
 #include <afs/stds.h>
 #include <afs/vice.h>
 #include <afs/venus.h>
+#include <afs/sys_prototypes.h>
 
 #ifndef MAP_FAILED
 #define MAP_FAILED ((void *)-1)
index 0e3bd5b..70a9342 100644 (file)
@@ -31,7 +31,9 @@
  * SUCH DAMAGE.
  */
 
-#define _LARGEFILE64_SOURCE
+#ifndef _LARGEFILE64_SOURCE
+# define _LARGEFILE64_SOURCE
+#endif
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
index 1891f98..07bbcf0 100644 (file)
@@ -81,9 +81,6 @@ main(int argc, char **argv)
 {
     const char *file;
     size_t sz;
-    char *random_buf;
-    char *read_buf1;
-    char *read_buf2;
     int fd;
 
     if (argc != 3)
index 1c7100e..97c23bf 100644 (file)
@@ -184,7 +184,7 @@ xfon_voldump(XFILE * X, int flag, char *name)
     struct ktc_principal sname;
     struct ktc_token token;
     struct afsconf_dir *confdir;
-    afs_uint32 code, server_addr;
+    afs_uint32 code, server_addr = 0;
     afs_int32 volid, date, partid = 0;
     int isnum, index;
     char *x, *y;