X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/369c919f2be8d2c93b990a97436b41ba4ae1ff29..4e99adb0d3727c0ae41edc9b3f52448d0d5b7655:/test/interactive-helper/extract-control.cc diff --git a/test/interactive-helper/extract-control.cc b/test/interactive-helper/extract-control.cc index 29dcbf371..852ec4ee9 100644 --- a/test/interactive-helper/extract-control.cc +++ b/test/interactive-helper/extract-control.cc @@ -1,12 +1,16 @@ +#include <config.h> + #include <apt-pkg/debfile.h> #include <apt-pkg/error.h> +#include <apt-pkg/fileutl.h> +#include <string> #include <iostream> #include <unistd.h> using namespace std; -bool ExtractMember(const char *File,const char *Member) +static bool ExtractMember(const char *File,const char *Member) { FileFd Fd(File,FileFd::ReadOnly); debDebFile Deb(Fd); @@ -20,8 +24,7 @@ bool ExtractMember(const char *File,const char *Member) if (Extract.Control == 0) return true; - write(STDOUT_FILENO,Extract.Control,Extract.Length); - return true; + return write(STDOUT_FILENO,Extract.Control,Extract.Length) != -1; } int main(int argc, const char *argv[])