diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2009-02-17 13:39:40 +0100 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-02-17 13:39:40 +0100 |
commit | 358504bb7869e73e38abcbc78b50d441f693711e (patch) | |
tree | 65da5b356c7913d9267c8f2c6459fcd87acc50f1 | |
parent | ee27874baa43db7d697b5de72938e4ccb71bdabb (diff) | |
download | blktrace-358504bb7869e73e38abcbc78b50d441f693711e.tar.gz blktrace-358504bb7869e73e38abcbc78b50d441f693711e.tar.bz2 |
O_NOATIME isn't always present
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r-- | btreplay/btreplay.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/btreplay/btreplay.c b/btreplay/btreplay.c index 23e13b8..2d122ca 100644 --- a/btreplay/btreplay.c +++ b/btreplay/btreplay.c @@ -1317,11 +1317,18 @@ static void *replay_sub(void *arg) char path[MAXPATHLEN]; struct io_bunch bunch; struct thr_info *tip = arg; + int oflags; pin_to_cpu(tip); sprintf(path, "/dev/%s", map_dev(tip->devnm)); - tip->ofd = open(path, O_RDWR | O_DIRECT | O_NOATIME); + +#ifdef O_NOATIME + oflags = O_NOATIME; +#else + oflags = 0; +#endif + tip->ofd = open(path, O_RDWR | O_DIRECT | oflags); if (tip->ofd < 0) { fatal(path, ERR_SYSCALL, "Failed device open\n"); /*NOTREACHED*/ |