From a05bd42ddbe73c726d062829c3295e7e315ee653 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 2 Apr 2007 10:42:33 +0200 Subject: [PATCH 1/1] 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 --- engines/sg.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; } -- 2.25.1