Fall back to sync() if syncfs() is unavailable
It seems better to err on the side of safety (vs. performance).
(cherry picked from commit 90a1e6abbd
)
This commit is contained in:
parent
7e42fb5efd
commit
0677fce533
@ -237,6 +237,8 @@ int do_unpack(void)
|
|||||||
cwd_fd = open(".", O_RDONLY);
|
cwd_fd = open(".", O_RDONLY);
|
||||||
if (cwd_fd >= 0 && syncfs(cwd_fd) == 0 && close(cwd_fd) == 0)
|
if (cwd_fd >= 0 && syncfs(cwd_fd) == 0 && close(cwd_fd) == 0)
|
||||||
errno = saved_errno;
|
errno = saved_errno;
|
||||||
|
#else
|
||||||
|
sync();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
send_status_and_crc(errno, untrusted_namebuf);
|
send_status_and_crc(errno, untrusted_namebuf);
|
||||||
|
Loading…
Reference in New Issue
Block a user