Merge branch 'patch-1' of https://github.com/hannesweisbach/fio
authorJens Axboe <axboe@kernel.dk>
Tue, 29 Oct 2019 19:39:14 +0000 (13:39 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 29 Oct 2019 19:39:14 +0000 (13:39 -0600)
* 'patch-1' of https://github.com/hannesweisbach/fio:
  Fix output redirection of exec_prerun/_postrun

1  2 
backend.c

diff --combined backend.c
index cb15b0e626ea1264f39f16532dfde454706248eb,54273f8ddd5c04fc43b8622fba1e6979958bad26..1c339408fa5fd0338cdd0e98444b5a7a2fa509a8
+++ b/backend.c
@@@ -1236,7 -1236,7 +1236,7 @@@ static int init_io_u(struct thread_dat
                ptr = fio_memalign(cl_align, sizeof(*io_u), td_offload_overlap(td));
                if (!ptr) {
                        log_err("fio: unable to allocate aligned memory\n");
 -                      break;
 +                      return 1;
                }
  
                io_u = ptr;
@@@ -1469,12 -1469,12 +1469,12 @@@ static bool keep_running(struct thread_
  
  static int exec_string(struct thread_options *o, const char *string, const char *mode)
  {
-       size_t newlen = strlen(string) + strlen(o->name) + strlen(mode) + 9 + 1;
+       size_t newlen = strlen(string) + strlen(o->name) + strlen(mode) + 13 + 1;
        int ret;
        char *str;
  
        str = malloc(newlen);
-       sprintf(str, "%s &> %s.%s.txt", string, o->name, mode);
+       sprintf(str, "%s > %s.%s.txt 2>&1", string, o->name, mode);
  
        log_info("%s : Saving output of %s in %s.%s.txt\n",o->name, mode, o->name, mode);
        ret = system(str);