From 339af39daba3e7230c001c432d7753b3073dfda9 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 11 Mar 2002 07:39:15 +0000 Subject: 2002-03-10 Roland McGrath * dev.c (dev_read): Return success with *LEN = 0 when reading exactly at the end of the store. --- storeio/dev.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/storeio/dev.c b/storeio/dev.c index f82200e8..9a9694b2 100644 --- a/storeio/dev.c +++ b/storeio/dev.c @@ -1,6 +1,6 @@ /* store `device' I/O - Copyright (C) 1995,96,98,99,2000,2001 Free Software Foundation, Inc. + Copyright (C) 1995,96,98,99,2000,01,02 Free Software Foundation, Inc. Written by Miles Bader This program is free software; you can redistribute it and/or @@ -433,6 +433,13 @@ dev_read (struct dev *dev, off_t offs, size_t whole_amount, } } + if (dev->store->size > 0 && offs == dev->store->size) + { + /* Reading end of file. */ + *len = 0; + return 0; + } + if (dev->inhibit_cache) { /* Under --no-cache, we permit only whole-block reads. -- cgit v1.2.3