Commit d973ba18 authored by Peter Maydell's avatar Peter Maydell Committed by Anthony Liguori
Browse files

osdep: Fix compilation failure on BSD systems



Fix compilation failure on BSD systems (which don't have
O_DIRECT or O_NOATIME:
osdep.c:116: error: ‘O_DIRECT’ undeclared (first use in this function)
osdep.c:116: error: (Each undeclared identifier is reported only once
osdep.c:116: error: for each function it appears in.)
osdep.c:116: error: ‘O_NOATIME’ undeclared (first use in this function)

Reviewed-by: default avatarStefan Weil <sw@weilnetz.de>
Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
parent 7d76ad4f
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -113,7 +113,13 @@ static int qemu_dup_flags(int fd, int flags)
    }

    /* Set/unset flags that we can with fcntl */
    setfl_flags = O_APPEND | O_ASYNC | O_DIRECT | O_NOATIME | O_NONBLOCK;
    setfl_flags = O_APPEND | O_ASYNC | O_NONBLOCK;
#ifdef O_NOATIME
    setfl_flags |= O_NOATIME;
#endif
#ifdef O_DIRECT
    setfl_flags |= O_DIRECT;
#endif
    dup_flags &= ~setfl_flags;
    dup_flags |= (flags & setfl_flags);
    if (fcntl(ret, F_SETFL, dup_flags) == -1) {