From 9cf80fa640ad09f932c4a3797b53952bd8dae38e Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Tue, 16 Jan 2007 14:06:57 +0000 Subject: [PATCH] * Don't do the offset sanity check on non-seekable devices. --- src/load-fd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/load-fd.c b/src/load-fd.c index e42bcb6..74faf78 100644 --- a/src/load-fd.c +++ b/src/load-fd.c @@ -169,10 +169,11 @@ static void offset_check(int fd) { /* Sanity check, can be OK though (for instance with a character device) */ #ifdef HAVE_LSEEK64 - if(lseek64_orig(fd, 0, SEEK_CUR) != _zz_getpos(fd)) + off64_t ret = lseek64_orig(fd, 0, SEEK_CUR); #else - if(lseek_orig(fd, 0, SEEK_CUR) != _zz_getpos(fd)) + off_t ret = lseek_orig(fd, 0, SEEK_CUR); #endif + if(ret != -1 && ret != _zz_getpos(fd)) debug("warning: offset inconsistency"); }