engines: add engine for file stat
[fio.git] / engines / sg.c
index a5a4b138f2555efaaeb97ef502fed2baf3204455..a1a6de4ce248dd680dc9d2f709479422de24b6de 100644 (file)
@@ -448,11 +448,12 @@ static enum fio_q_status fio_sgio_rw_doio(struct thread_data *td,
                        if (ret < 0)
                                return ret;
 
+                       __io_u = hdr->usr_ptr;
+
                        /* record if an io error occurred */
                        if (hdr->info & SG_INFO_CHECK)
-                               io_u->error = EIO;
+                               __io_u->error = EIO;
 
-                       __io_u = hdr->usr_ptr;
                        if (__io_u == io_u)
                                break;
 
@@ -1180,8 +1181,8 @@ static char *fio_sgio_errdetails(struct io_u *io_u)
        }
 
        if (!(hdr->info & SG_INFO_CHECK) && !strlen(msg))
-               strncpy(msg, "SG Driver did not report a Host, Driver or Device check",
-                       MAXERRDETAIL - 1);
+               snprintf(msg, MAXERRDETAIL, "%s",
+                        "SG Driver did not report a Host, Driver or Device check");
 
        return msg;
 }