Author: zooey Date: 2011-01-31 09:50:37 +0100 (Mon, 31 Jan 2011) New Revision: 40329 Changeset: http://dev.haiku-os.org/changeset/40329 Modified: haiku/trunk/headers/private/package/hpkg/FDCloser.h haiku/trunk/src/bin/package/command_extract.cpp Log: Fixed an oversight of yesterday's restructuring: * FDCloser is private, so it should live in BPackageKit::BHPKG::BPrivate * adjusted 'package' binary to no longer use FDCloser (trivial) * minor cleanup in command_extract.cpp Modified: haiku/trunk/headers/private/package/hpkg/FDCloser.h =================================================================== --- haiku/trunk/headers/private/package/hpkg/FDCloser.h 2011-01-31 08:24:42 UTC (rev 40328) +++ haiku/trunk/headers/private/package/hpkg/FDCloser.h 2011-01-31 08:50:37 UTC (rev 40329) @@ -2,15 +2,17 @@ * Copyright 2009, Ingo Weinhold, ingo_weinhold@xxxxxxx * Distributed under the terms of the MIT License. */ -#ifndef _PACKAGE__HPKG__FD_CLOSER_H_ -#define _PACKAGE__HPKG__FD_CLOSER_H_ +#ifndef _PACKAGE__HPKG__PRIVATE__FD_CLOSER_H_ +#define _PACKAGE__HPKG__PRIVATE__FD_CLOSER_H_ namespace BPackageKit { namespace BHPKG { +namespace BPrivate { + struct FDCloser { FDCloser(int fd) : @@ -29,9 +31,11 @@ }; +} // namespace BPrivate + } // namespace BHPKG } // namespace BPackageKit -#endif // _PACKAGE__HPKG__FD_CLOSER_H_ +#endif // _PACKAGE__HPKG__PRIVATE__FD_CLOSER_H_ Modified: haiku/trunk/src/bin/package/command_extract.cpp =================================================================== --- haiku/trunk/src/bin/package/command_extract.cpp 2011-01-31 08:24:42 UTC (rev 40328) +++ haiku/trunk/src/bin/package/command_extract.cpp 2011-01-31 08:50:37 UTC (rev 40329) @@ -21,7 +21,6 @@ #include <AutoDeleter.h> -#include <package/hpkg/FDCloser.h> #include <package/hpkg/PackageContentHandler.h> #include <package/hpkg/PackageDataReader.h> #include <package/hpkg/PackageEntry.h> @@ -198,7 +197,6 @@ strerror(errno)); return errno; } - FDCloser fdCloser(fd); // write data status_t error; @@ -210,10 +208,9 @@ } else error = _ExtractFileData(&fPackageFileReader, data, fd); - if (error != B_OK) - return error; + close(fd); - return B_OK; + return error; } virtual status_t HandleEntryDone(BPackageEntry* entry)