efi: add cleanup handler for closing file descriptors

This commit is contained in:
Lennart Poettering
2018-10-16 16:44:34 +02:00
parent b73acaed42
commit 3aaa95e0a0
+7
View File
@@ -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);
}