Fall back to sync() if syncfs() is unavailable

It seems better to err on the side of safety (vs. performance).
This commit is contained in:
Rusty Bird 2017-06-16 16:13:44 +00:00
parent da3f3cd426
commit 90a1e6abbd
No known key found for this signature in database
GPG Key ID: 469D78F47AAF2ADF

View File

@ -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);