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 <jerome.duval@gmail.com>
This commit is contained in:
parent
9219768a97
commit
b29db8ebbb
@ -254,6 +254,11 @@ struct FileDescriptorCloser {
|
||||
SetTo(-1);
|
||||
}
|
||||
|
||||
inline int Get()
|
||||
{
|
||||
return fDescriptor;
|
||||
}
|
||||
|
||||
inline int Detach()
|
||||
{
|
||||
int descriptor = fDescriptor;
|
||||
|
Loading…
Reference in New Issue
Block a user