* follow hint by Axel: drop FDCloser and use shared class

FileDescriptorCloser instead


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40330 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Tappe
2011-01-31 09:40:37 +00:00
parent ae53f5526b
commit 15a5c3f7d9
4 changed files with 4 additions and 55 deletions
-41
View File
@@ -1,41 +0,0 @@
/*
* Copyright 2009, Ingo Weinhold, [email protected].
* Distributed under the terms of the MIT License.
*/
#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)
:
fFD(fd)
{
}
~FDCloser()
{
if (fFD >= 0)
close(fFD);
}
private:
int fFD;
};
} // namespace BPrivate
} // namespace BHPKG
} // namespace BPackageKit
#endif // _PACKAGE__HPKG__PRIVATE__FD_CLOSER_H_