]>
git.proxmox.com Git - efi-boot-shim.git/blob - errlog.c
3 * Copyright 2017 Peter Jones <pjones@redhat.com>
5 * Distributed under terms of the GPLv3 license.
10 static CHAR16
**errs
= NULL
;
11 static UINTN nerrs
= 0;
14 VLogError(const char *file
, int line
, const char *func
, CHAR16
*fmt
, va_list args
)
19 newerrs
= ReallocatePool(errs
, (nerrs
+ 1) * sizeof(*errs
),
20 (nerrs
+ 3) * sizeof(*errs
));
22 return EFI_OUT_OF_RESOURCES
;
24 newerrs
[nerrs
] = PoolPrint(L
"%a:%d %a() ", file
, line
, func
);
26 return EFI_OUT_OF_RESOURCES
;
28 newerrs
[nerrs
+1] = VPoolPrint(fmt
, args2
);
29 if (!newerrs
[nerrs
+1])
30 return EFI_OUT_OF_RESOURCES
;
34 newerrs
[nerrs
] = NULL
;
41 LogError_(const char *file
, int line
, const char *func
, CHAR16
*fmt
, ...)
44 EFI_STATUS efi_status
;
47 efi_status
= VLogError(file
, line
, func
, fmt
, args
);
61 for (i
= 0; i
< nerrs
; i
++)
62 console_print(L
"%s", errs
[i
]);
70 for (i
= 0; i
< nerrs
; i
++)
77 // vim:fenc=utf-8:tw=75