1
1
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:
Lennart Poettering 2018-06-21 18:50:07 +02:00
parent b73acaed42
commit 3aaa95e0a0

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);
}