AutoDeleter: add Get method for FileDescriptorCloser
This allows to use FileDescriptorCloser as unique pointer for file descriptor. Change-Id: I4c768fafba6ed35658b2fdb075b9b547f53bc8da Reviewed-on: https://review.haiku-os.org/c/haiku/+/2495 Reviewed-by: Jérôme Duval <[email protected]>
This commit is contained in:
@@ -254,6 +254,11 @@ struct FileDescriptorCloser {
|
||||
SetTo(-1);
|
||||
}
|
||||
|
||||
inline int Get()
|
||||
{
|
||||
return fDescriptor;
|
||||
}
|
||||
|
||||
inline int Detach()
|
||||
{
|
||||
int descriptor = fDescriptor;
|
||||
|
||||
Reference in New Issue
Block a user