mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-03-08 20:58:20 +03:00
efi: add cleanup handler for closing file descriptors
This commit is contained in:
parent
b73acaed42
commit
3aaa95e0a0
@ -38,3 +38,10 @@ static inline void FreePoolp(void *p) {
|
||||
|
||||
#define _cleanup_(x) __attribute__((cleanup(x)))
|
||||
#define _cleanup_freepool_ _cleanup_(FreePoolp)
|
||||
|
||||
static inline void FileHandleClosep(EFI_FILE_HANDLE *handle) {
|
||||
if (!*handle)
|
||||
return;
|
||||
|
||||
uefi_call_wrapper((*handle)->Close, 1, *handle);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user