From 90a1e6abbd3d9fd2aff6dfc7bcd1f2f602ee72f6 Mon Sep 17 00:00:00 2001 From: Rusty Bird Date: Fri, 16 Jun 2017 16:13:44 +0000 Subject: [PATCH] Fall back to sync() if syncfs() is unavailable It seems better to err on the side of safety (vs. performance). --- qrexec-lib/unpack.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qrexec-lib/unpack.c b/qrexec-lib/unpack.c index 4d3acf5..c7513e8 100644 --- a/qrexec-lib/unpack.c +++ b/qrexec-lib/unpack.c @@ -237,6 +237,8 @@ int do_unpack(void) cwd_fd = open(".", O_RDONLY); if (cwd_fd >= 0 && syncfs(cwd_fd) == 0 && close(cwd_fd) == 0) errno = saved_errno; +#else + sync(); #endif send_status_and_crc(errno, untrusted_namebuf);