Message ID | 202106080333.1583XKdU006091@slippy.cwsent.com |
---|---|
State | Accepted |
Headers | show |
Series | utils: FreeBSD supports fdatasync(2) | expand |
On Mon, Jun 07, 2021 at 08:33:20PM -0700, Cy Schubert wrote:
> FreeBSD supports fdatasync(2). Enable it in os_unix.c.
Thanks, applied.
diff --git a/src/utils/os_unix.c b/src/utils/os_unix.c index 1de37204d..258deef9d 100644 --- a/src/utils/os_unix.c +++ b/src/utils/os_unix.c @@ -464,9 +464,9 @@ int os_file_exists(const char *fname) int os_fdatasync(FILE *stream) { if (!fflush(stream)) { -#ifdef __linux__ +#if defined __FreeBSD__ || defined __linux__ return fdatasync(fileno(stream)); -#else /* !__linux__ */ +#else /* !__linux__ && !__FreeBSD__ */ #ifdef F_FULLFSYNC /* OS X does not implement fdatasync(). */ return fcntl(fileno(stream), F_FULLFSYNC);
FreeBSD supports fdatasync(2). Enable it in os_unix.c. Signed-off-by: Cy Schubert <cy@FreeBSD.org> --- src/utils/os_unix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)