Add more context to the error messages
Errors like:
fio: pid=0, err=22/file:filesetup.c:380, error=Invalid argument
do not give a lot of clue as to what is wrong, unless you
have a matching source. So add a context relevant info
message as well.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/init.c b/init.c
index a235e2f..c8f27ad 100644
--- a/init.c
+++ b/init.c
@@ -725,7 +725,7 @@
if (td->directory && td->directory[0] != '\0') {
if (lstat(td->directory, &sb) < 0) {
log_err("fio: %s is not a directory\n", td->directory);
- td_verror(td, errno);
+ td_verror(td, errno, "lstat");
return 1;
}
if (!S_ISDIR(sb.st_mode)) {
@@ -850,12 +850,12 @@
fd = open("/dev/urandom", O_RDONLY);
if (fd == -1) {
- td_verror(td, errno);
+ td_verror(td, errno, "open");
return 1;
}
if (read(fd, seeds, sizeof(seeds)) < (int) sizeof(seeds)) {
- td_verror(td, EIO);
+ td_verror(td, EIO, "read");
close(fd);
return 1;
}