X-Git-Url: https://git.openafs.org/?p=openafs.git;a=blobdiff_plain;f=src%2Ftests%2Fdumptool.c;h=57c45a5e616af6c569636569ba6e90c89598ff82;hp=e67d713d4ffd4d81b99aa993c522c0d4d3ba2dae;hb=3c4dd454dd61d9dc96ae32a41ff71a9e626ef458;hpb=3f73524386f38f1a6fe004fec4dee6afbc3f288c diff --git a/src/tests/dumptool.c b/src/tests/dumptool.c index e67d713..57c45a5 100644 --- a/src/tests/dumptool.c +++ b/src/tests/dumptool.c @@ -71,6 +71,7 @@ #include #include #include +#include #include #include @@ -83,6 +84,9 @@ #include #include +#ifdef AFS_LINUX24_ENV +#define _LARGEFILE64_SOURCE 1 +#endif #ifdef RESIDENCY #include #include @@ -309,6 +313,7 @@ main(int argc, char *argv[]) char *p; struct winsize win; FILE *f; + int fd; #ifdef RESIDENCY for (i = 0; i < RS_MAXRESIDENCIES; i++) { @@ -430,12 +435,22 @@ main(int argc, char *argv[]) * Try opening the dump file */ - if ((f = fopen(argv[optind], "rb")) == NULL) { +#ifdef O_LARGEFILE + if ((fd = open(argv[optind], O_RDONLY | O_LARGEFILE)) < 0) { +#else + if ((fd = open(argv[optind], O_RDONLY)) < 0) { +#endif fprintf(stderr, "open of dumpfile %s failed: %s\n", argv[optind], strerror(errno)); exit(1); } + if ((f = fdopen(fd, "rb")) == NULL) { + fprintf(stderr, "fdopen of dumpfile %s failed: %s\n", argv[optind], + strerror(errno)); + exit(1); + } + if (ReadDumpHeader(f, &dheader)) { fprintf(stderr, "Failed to read dump header!\n"); exit(1);