mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zdump: Fix /dev/mem reading
This commit makes zgetdump work with /dev/mem again.
zg_seek() should not attempt to verify the given offset for devices before
issuing lseek() because special devices like /dev/mem report 0 in
stat.sb_size.
$ zgetdump -i /dev/mem
zgetdump: Trying to seek past file end "/dev/mem"
Fixes: 11e78cada5 ("zdump: catch attempts to seek past end of file in zg_seek()")
Signed-off-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
02a0d12988
commit
455ad953a9
+1
-1
@@ -280,7 +280,7 @@ off_t zg_seek(struct zg_fh *zg_fh, off_t off, enum zg_check check)
|
||||
{
|
||||
off_t rc;
|
||||
|
||||
if (off >= zg_fh->sb.st_size)
|
||||
if (S_ISREG(zg_fh->sb.st_mode) && off >= zg_fh->sb.st_size)
|
||||
ERR_EXIT("Trying to seek past file end \"%s\"", zg_fh->path);
|
||||
|
||||
rc = lseek(zg_fh->fh, off, SEEK_SET);
|
||||
|
||||
Reference in New Issue
Block a user