summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-04-21 12:47:36 +0200
committerLennart Poettering <lennart@poettering.net>2016-04-25 12:14:17 +0200
commit6402d5c628f1872a4874508bbe975aaac1cc747b (patch)
treecc3c0d7cc74ce1b2a05c532541f756dcf9174e7a
parent4f4d6ee4be1c5d3bb2f3ebce7d2d332285963830 (diff)
util: copy_file_range() returns EBADF when used on a tty
In nspawn we invoke copy_bytes() on a TTY fd. copy_file_range() returns EBADF on a TTY and this error is considered fatal by copy_bytes() so far. Correct that, so that nspawn's copy_bytes() operation works again. This is a follow-up for a44202e98b638024c45e50ad404c7069c7835c04.
-rw-r--r--src/basic/copy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/basic/copy.c b/src/basic/copy.c
index e2db4be9ff..03487a6878 100644
--- a/src/basic/copy.c
+++ b/src/basic/copy.c
@@ -102,7 +102,7 @@ int copy_bytes(int fdf, int fdt, uint64_t max_bytes, bool try_reflink) {
if (try_cfr) {
n = try_copy_file_range(fdf, NULL, fdt, NULL, m, 0u);
if (n < 0) {
- if (!IN_SET(n, -EINVAL, -ENOSYS, -EXDEV))
+ if (!IN_SET(n, -EINVAL, -ENOSYS, -EXDEV, -EBADF))
return n;
try_cfr = false;