[PATCH] Add fio_assert()
[fio.git] / fio.c
diff --git a/fio.c b/fio.c
index 10625f26afd25fd54d72bb896a17c075f0681401..ace8c5ee09aae9e4353d9879273eaadbe1c2848d 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -26,6 +26,7 @@
 #include <string.h>
 #include <signal.h>
 #include <time.h>
+#include <locale.h>
 #include <sys/stat.h>
 #include <sys/wait.h>
 #include <sys/ipc.h>
@@ -381,7 +382,7 @@ static void do_io(struct thread_data *td)
 
        td_set_runstate(td, TD_RUNNING);
 
-       while (td->this_io_bytes[td->ddir] < td->io_size) {
+       while ((td->this_io_bytes[0] + td->this_io_bytes[1]) < td->io_size) {
                struct timespec *timeout;
                int min_evts = 0;
                struct io_u *io_u;
@@ -411,7 +412,6 @@ requeue:
                                io_u->xfer_buf += ret;
                                goto requeue;
                        } else {
-                               td_verror(td, io_u->error);
                                put_io_u(td, io_u);
                                break;
                        }
@@ -1005,6 +1005,13 @@ int main(int argc, char *argv[])
 {
        long ps;
 
+       /*
+        * We need locale for number printing, if it isn't set then just
+        * go with the US format.
+        */
+       if (!getenv("LC_NUMERIC"))
+               setlocale(LC_NUMERIC, "en_US");
+
        if (parse_options(argc, argv))
                return 1;