projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add more context to the error messages
[fio.git]
/
engines
/
sg.c
diff --git
a/engines/sg.c
b/engines/sg.c
index 27139760ba5bd14354c0e8a6e8c5bec666938463..b9033b8f7c2a0c8528b35d28f776ef62062028ad 100644
(file)
--- a/
engines/sg.c
+++ b/
engines/sg.c
@@
-95,9
+95,9
@@
static int fio_sgio_getevents(struct thread_data *td, int min, int max,
ret = poll(sd->pfds, td->nr_files, -1);
if (ret < 0) {
ret = poll(sd->pfds, td->nr_files, -1);
if (ret < 0) {
- td_verror(td, errno);
if (!r)
if (!r)
- r = -1;
+ r = -errno;
+ td_verror(td, errno, "poll");
break;
} else if (!ret)
continue;
break;
} else if (!ret)
continue;
@@
-117,8
+117,8
@@
re_read:
if (ret < 0) {
if (errno == EAGAIN)
continue;
if (ret < 0) {
if (errno == EAGAIN)
continue;
-
td_verror(td, errno)
;
-
r = -1
;
+
r = -errno
;
+
td_verror(td, errno, "read")
;
break;
} else if (ret) {
p += ret;
break;
} else if (ret) {
p += ret;
@@
-162,7
+162,7
@@
static int fio_sgio_ioctl_doio(struct thread_data *td,
ret = ioctl(f->fd, SG_IO, hdr);
if (ret < 0)
ret = ioctl(f->fd, SG_IO, hdr);
if (ret < 0)
- return
ret
;
+ return
-errno
;
return FIO_Q_COMPLETED;
}
return FIO_Q_COMPLETED;
}
@@
-179,7
+179,7
@@
static int fio_sgio_rw_doio(struct fio_file *f, struct io_u *io_u, int sync)
if (sync) {
ret = read(f->fd, hdr, sizeof(*hdr));
if (ret < 0)
if (sync) {
ret = read(f->fd, hdr, sizeof(*hdr));
if (ret < 0)
- return errno;
+ return
-
errno;
return FIO_Q_COMPLETED;
}
return FIO_Q_COMPLETED;
}
@@
-253,7
+253,7
@@
static int fio_sgio_queue(struct thread_data *td, struct io_u *io_u)
}
if (io_u->error) {
}
if (io_u->error) {
- td_verror(td, io_u->error);
+ td_verror(td, io_u->error
, "xfer"
);
return FIO_Q_COMPLETED;
}
return FIO_Q_COMPLETED;
}
@@
-339,14
+339,14
@@
static int fio_sgio_init(struct thread_data *td)
if (td->filetype == FIO_TYPE_BD) {
if (ioctl(f->fd, BLKSSZGET, &bs) < 0) {
if (td->filetype == FIO_TYPE_BD) {
if (ioctl(f->fd, BLKSSZGET, &bs) < 0) {
- td_verror(td, errno);
+ td_verror(td, errno
, "ioctl"
);
goto err;
}
} else if (td->filetype == FIO_TYPE_CHAR) {
int version;
if (ioctl(f->fd, SG_GET_VERSION_NUM, &version) < 0) {
goto err;
}
} else if (td->filetype == FIO_TYPE_CHAR) {
int version;
if (ioctl(f->fd, SG_GET_VERSION_NUM, &version) < 0) {
- td_verror(td, errno);
+ td_verror(td, errno
, "ioctl"
);
goto err;
}
goto err;
}