From: Theodore Ts'o Date: Wed, 2 Jul 1997 02:41:59 +0000 (+0000) Subject: ChangeLog, ext2_err.et.in, unix_io.c: X-Git-Tag: PQ_SNAPSHOT_971103~46 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=a1230b1376dc5514a260134f53c23f8d2d1e61ce;p=tools%2Fe2fsprogs.git ChangeLog, ext2_err.et.in, unix_io.c: unix_io.c (unix_read_blk): If ext2fs_llseek() fails, but errno is zero, then return EXT2_IO_LLSEEK_FAILED. ext2_err.et.in: Add a new error code, EXT2_IO_LLSEEK_FAILED. --- diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog index 135aad2..5733631 100644 --- a/lib/ext2fs/ChangeLog +++ b/lib/ext2fs/ChangeLog @@ -1,5 +1,10 @@ Tue Jun 17 01:33:20 1997 Theodore Ts'o + * unix_io.c (unix_read_blk): If ext2fs_llseek() fails, but errno + is zero, then return EXT2_IO_LLSEEK_FAILED. + + * ext2_err.et.in: Add a new error code, EXT2_IO_LLSEEK_FAILED. + * Release of E2fsprogs 1.11 Mon Jun 16 23:53:06 1997 Theodore Ts'o diff --git a/lib/ext2fs/ext2_err.et.in b/lib/ext2fs/ext2_err.et.in index 075acee..a51825c 100644 --- a/lib/ext2fs/ext2_err.et.in +++ b/lib/ext2fs/ext2_err.et.in @@ -224,4 +224,7 @@ ec EXT2_ET_UNSUPP_FEATURE, ec EXT2_ET_RO_UNSUPP_FEATURE, "Filesystem has unsupported read-only feature(s)" +ec EXT2_IO_LLSEEK_FAILED, + "IO Channel failed to seek on read or write" + end diff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c index c2007aa..2be3e70 100644 --- a/lib/ext2fs/unix_io.c +++ b/lib/ext2fs/unix_io.c @@ -193,7 +193,7 @@ static errcode_t unix_read_blk(io_channel channel, unsigned long block, size = (count < 0) ? -count : count * channel->block_size; location = (ext2_loff_t) block * channel->block_size; if (ext2fs_llseek(data->dev, location, SEEK_SET) != location) { - retval = errno; + retval = errno ? errno : EXT2_IO_LLSEEK_FAILED; goto error_out; } actual = read(data->dev, buf, size); @@ -242,7 +242,7 @@ static errcode_t unix_write_blk(io_channel channel, unsigned long block, location = (ext2_loff_t) block * channel->block_size; if (ext2fs_llseek(data->dev, location, SEEK_SET) != location) { - retval = errno; + retval = errno ? errno : EXT2_IO_LLSEEK_FAILED; goto error_out; }