From 0cfcfa29e29a87202115afc0d44a938f431517d9 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 15 Dec 1997 13:38:06 +0000 Subject: [PATCH] added some more debug info to the "EOF in map_ptr" error message to try to make it easier to track down what is going wrong. Jarom, can you let me know what output this gives? PS: the cvs commit messages for rsync are now sent to the rsync mailing list. This will allow everyone to see what changes are being made. --- util.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/util.c b/util.c index 4301465e..3ecd8120 100644 --- a/util.c +++ b/util.c @@ -55,6 +55,8 @@ struct map_struct *map_file(int fd,off_t len) char *map_ptr(struct map_struct *map,off_t offset,int len) { + int nread = -2; + if (map->map) return map->map+offset; @@ -79,8 +81,9 @@ char *map_ptr(struct map_struct *map,off_t offset,int len) } if (lseek(map->fd,offset,SEEK_SET) != offset || - read(map->fd,map->p,len) != len) { - fprintf(FERROR,"EOF in map_ptr!\n"); + (nread=read(map->fd,map->p,len)) != len) { + fprintf(FERROR,"EOF in map_ptr! (offset=%d len=%d nread=%d errno=%d)\n", + (int)offset, len, nread, errno); exit_cleanup(1); } -- 2.34.1