Skip to content

Commit

Permalink
Initialize resid variable
Browse files Browse the repository at this point in the history
Properly initialize the variable resid for the error case where
vn_rdwr() returns an error with setting *resid.  In practice
this is harmless because the contents of resid don't matter
when vn_rdwr() returns an error.  But the code does check the
result which means we may or may not end up having the check
zio->io_error.  This makes gcc unhappy and having a completely
deterministic code path here is a good thing.

Closes #51
  • Loading branch information
behlendorf committed Aug 13, 2010
1 parent 11ce7ab commit 2b89d86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/zfs/vdev_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ vdev_file_io_start(zio_t *zio)
{
vdev_t *vd = zio->io_vd;
vdev_file_t *vf = vd->vdev_tsd;
ssize_t resid;
ssize_t resid = 0;

if (zio->io_type == ZIO_TYPE_IOCTL) {
/* XXPOLICY */
Expand Down

0 comments on commit 2b89d86

Please sign in to comment.