summaryrefslogtreecommitdiff
path: root/cmdline/apt-helper.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cmdline/apt-helper.cc')
-rw-r--r--cmdline/apt-helper.cc12
1 files changed, 2 insertions, 10 deletions
diff --git a/cmdline/apt-helper.cc b/cmdline/apt-helper.cc
index a519f3042..5e0b00c46 100644
--- a/cmdline/apt-helper.cc
+++ b/cmdline/apt-helper.cc
@@ -111,8 +111,6 @@ static bool DoCatFile(CommandLine &CmdL) /*{{{*/
{
FileFd fd;
FileFd out;
- char buf[4096];
- unsigned long long read;
if (out.OpenDescriptor(STDOUT_FILENO, FileFd::WriteOnly) == false)
return false;
@@ -127,14 +125,8 @@ static bool DoCatFile(CommandLine &CmdL) /*{{{*/
if (fd.Open(name, FileFd::ReadOnly, FileFd::Extension) == false)
return false;
- for (;;) {
- if (fd.Read(buf, sizeof(buf), &read) == false)
- return false;
- if (read == 0)
- break;
- if (out.Write(buf, read) == false)
- return false;
- }
+ if (CopyFile(fd, out) == false)
+ return false;
}
return true;
}