It was a little all-over-the-place, unify it - return -1 for error,
let the caller look at errno for the specific error.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
ret = ioctl(f->fd, SG_IO, hdr);
if (ret < 0)
- return -errno;
+ return ret;
return FIO_Q_COMPLETED;
}
ret = write(f->fd, hdr, sizeof(*hdr));
if (ret < 0)
- return errno;
+ return ret;
if (sync) {
ret = read(f->fd, hdr, sizeof(*hdr));
if (ret < 0)
- return -errno;
+ return ret;
return FIO_Q_COMPLETED;
}