Explicitly check td_trim(td) to detect open(2) flag
[fio.git] / filesetup.c
index 9388bfc94b419e54e670b7410affda94c97ef9ea..fab9c5dec70b844aa40004ef98cc1794234927c3 100644 (file)
@@ -619,7 +619,8 @@ open_again:
                        f->fd = dup(STDIN_FILENO);
                else
                        from_hash = file_lookup_open(f, flags);
-       } else { //td trim
+       } else if (td_trim(td)) {
+               assert(!td_rw(td)); /* should have matched above */
                flags |= O_RDWR;
                from_hash = file_lookup_open(f, flags);
        }