From: Jens Axboe Date: Mon, 2 Apr 2007 08:42:33 +0000 (+0200) Subject: sg engine: errno return value fixes X-Git-Tag: fio-1.15.1~3 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=a05bd42ddbe73c726d062829c3295e7e315ee653 sg engine: errno return value fixes 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 --- diff --git a/engines/sg.c b/engines/sg.c index 99c5856a..44e151b6 100644 --- a/engines/sg.c +++ b/engines/sg.c @@ -166,7 +166,7 @@ static int fio_sgio_ioctl_doio(struct thread_data *td, ret = ioctl(f->fd, SG_IO, hdr); if (ret < 0) - return -errno; + return ret; return FIO_Q_COMPLETED; } @@ -178,12 +178,12 @@ static int fio_sgio_rw_doio(struct fio_file *f, struct io_u *io_u, int sync) 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; }