From: Derrick Brashear Date: Wed, 14 Jan 2004 21:30:59 +0000 (+0000) Subject: kdump-linux-sucks-more-20040113 X-Git-Tag: openafs-devel-1_3_60~107 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=8730b44612435377a114a024efdb920b78db1897;p=packages%2Fo%2Fopenafs.git kdump-linux-sucks-more-20040113 make it build on newer rhel attempt to deal with hugemem kernel dumbness --- diff --git a/src/venus/kdump.c b/src/venus/kdump.c index eb52a65e3..9374742ba 100644 --- a/src/venus/kdump.c +++ b/src/venus/kdump.c @@ -17,10 +17,14 @@ RCSID #include #include /* for malloc() */ +/* Here be hacks. */ #ifdef AFS_LINUX24_ENV #define __KERNEL__ #include #define _STRING_H 1 +#define _SYS_STATFS_H 1 +#define _BITS_SIGCONTEXT_H 1 +#undef USE_UCONTEXT #endif #include @@ -2314,17 +2318,20 @@ kread(int kmem, off_t loc, void *buf, KDUMP_SIZE_T len) perror("lseek"); exit(1); } - if ((i = read(kmem, buf, len)) != len) { - printf("WARNING: Read failed: "); - if (sizeof(loc) > sizeof(long)) { - printf("loc=%llx", loc); - } else { - printf("loc=%lx", (long)loc); + if (loc == 0) + printf("WARNING: Read failed: loc=0\n"); + else + if ((i = read(kmem, buf, len)) != len) { + printf("WARNING: Read failed: "); + if (sizeof(loc) > sizeof(long)) { + printf("loc=%llx", loc); + } else { + printf("loc=%lx", (long)loc); + } + printf(", buf=%lx, len=%ld, i=%d, errno=%d\n", (long)buf, + (long)len, i, errno); + return; /*exit(1); */ } - printf(", buf=%lx, len=%ld, i=%d, errno=%d\n", (long)buf, (long)len, - i, errno); - return; /*exit(1); */ - } #endif } #endif /* AFS_KDUMP_LIB */