Author: zooey Date: 2011-01-31 10:40:37 +0100 (Mon, 31 Jan 2011) New Revision: 40330 Changeset: http://dev.haiku-os.org/changeset/40330 Removed: haiku/trunk/headers/private/package/hpkg/FDCloser.h Modified: haiku/trunk/src/add-ons/kernel/file_systems/packagefs/Volume.cpp haiku/trunk/src/bin/package/command_create.cpp haiku/trunk/src/kits/package/hpkg/PackageWriterImpl.cpp Log: * follow hint by Axel: drop FDCloser and use shared class FileDescriptorCloser instead Modified: haiku/trunk/src/add-ons/kernel/file_systems/packagefs/Volume.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/packagefs/Volume.cpp 2011-01-31 08:50:37 UTC (rev 40329) +++ haiku/trunk/src/add-ons/kernel/file_systems/packagefs/Volume.cpp 2011-01-31 09:40:37 UTC (rev 40330) @@ -24,7 +24,6 @@ #include <Notifications.h> #include <package/hpkg/ErrorOutput.h> -#include <package/hpkg/FDCloser.h> #include <package/hpkg/PackageEntry.h> #include <package/hpkg/PackageEntryAttribute.h> #include <package/hpkg/PackageReaderImpl.h> Modified: haiku/trunk/src/bin/package/command_create.cpp =================================================================== --- haiku/trunk/src/bin/package/command_create.cpp 2011-01-31 08:50:37 UTC (rev 40329) +++ haiku/trunk/src/bin/package/command_create.cpp 2011-01-31 09:40:37 UTC (rev 40330) @@ -94,17 +94,6 @@ || strcmp(entry->d_name, "..") == 0) continue; -if (strcmp(entry->d_name, B_HPKG_PACKAGE_INFO_FILE_NAME) == 0) { - printf("parsing %s ...\n", entry->d_name); - struct ErrorListener : public BPackageInfo::ParseErrorListener { - virtual void OnError(const BString& msg, int line, int col) { - printf("*** parse error (%d:%d) -> %s\n", line, col, msg.String()); - } - } errorListener; - BEntry packageInfoEntry(entry->d_name); - BPackageInfo packageInfo; - packageInfo.ReadFromConfigFile(packageInfoEntry, &errorListener); -} error = packageWriter.AddEntry(entry->d_name); printf("AddEntry(\"%s\"): %s\n", entry->d_name, strerror(error)); if (error != B_OK) Modified: haiku/trunk/src/kits/package/hpkg/PackageWriterImpl.cpp =================================================================== --- haiku/trunk/src/kits/package/hpkg/PackageWriterImpl.cpp 2011-01-31 08:50:37 UTC (rev 40329) +++ haiku/trunk/src/kits/package/hpkg/PackageWriterImpl.cpp 2011-01-31 09:40:37 UTC (rev 40330) @@ -27,11 +27,13 @@ #include <package/hpkg/DataOutput.h> #include <package/hpkg/DataReader.h> -#include <package/hpkg/FDCloser.h> #include <package/hpkg/Stacker.h> #include <package/hpkg/ZlibCompressor.h> +using BPrivate::FileDescriptorCloser; + + namespace BPackageKit { namespace BHPKG { @@ -1089,7 +1091,7 @@ fileName, strerror(errno)); throw status_t(errno); } - FDCloser fdCloser(fd); + FileDescriptorCloser fdCloser(fd); // stat the node struct stat st;