diff options
author | smitsohu <smitsohu@gmail.com> | 2022-07-11 21:35:53 +0200 |
---|---|---|
committer | smitsohu <smitsohu@gmail.com> | 2022-07-11 21:35:53 +0200 |
commit | d991805cd27fe4fa8d11720e434c201ee10658d8 (patch) | |
tree | ae2576556ed1ade5aa9c42ddc665a3d42d6b6c77 /src | |
parent | simplify put option (diff) | |
download | firejail-d991805cd27fe4fa8d11720e434c201ee10658d8.tar.gz firejail-d991805cd27fe4fa8d11720e434c201ee10658d8.tar.zst firejail-d991805cd27fe4fa8d11720e434c201ee10658d8.zip |
remove dependency on sendfile syscall
Diffstat (limited to 'src')
-rw-r--r-- | src/firejail/chroot.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/firejail/chroot.c b/src/firejail/chroot.c index 551948318..ccd954a93 100644 --- a/src/firejail/chroot.c +++ b/src/firejail/chroot.c | |||
@@ -22,7 +22,6 @@ | |||
22 | #include "firejail.h" | 22 | #include "firejail.h" |
23 | #include "../include/gcov_wrapper.h" | 23 | #include "../include/gcov_wrapper.h" |
24 | #include <sys/mount.h> | 24 | #include <sys/mount.h> |
25 | #include <sys/sendfile.h> | ||
26 | #include <errno.h> | 25 | #include <errno.h> |
27 | 26 | ||
28 | #include <fcntl.h> | 27 | #include <fcntl.h> |
@@ -91,8 +90,8 @@ static void update_file(int parentfd, const char *relpath) { | |||
91 | close(in); | 90 | close(in); |
92 | goto errout; | 91 | goto errout; |
93 | } | 92 | } |
94 | if (sendfile(out, in, NULL, src.st_size) == -1) | 93 | if (copy_file_by_fd(in, out) != 0) |
95 | errExit("sendfile"); | 94 | errExit("copy_file_by_fd"); |
96 | close(in); | 95 | close(in); |
97 | close(out); | 96 | close(out); |
98 | return; | 97 | return; |