From b206bbe1d8a29f3d9db0f4f1fe6f3f90aeb98b0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Thu, 31 Aug 2006 12:21:57 +0000 Subject: [PATCH] stop the copy when not everything is written git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18724 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/bin/coreutils/src/copy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/coreutils/src/copy.c b/src/bin/coreutils/src/copy.c index f8d683b28a..9c02bbaa43 100644 --- a/src/bin/coreutils/src/copy.c +++ b/src/bin/coreutils/src/copy.c @@ -168,7 +168,7 @@ copy_attributes(int fromFd, int toFd) break; bytesWritten = fs_write_attr(toFd, dirent->d_name, info.type, pos, buffer, bytesRead); - if (bytesWritten <= 0) + if (bytesWritten != bytesRead) break; pos += bytesWritten;