efivar/SOURCES/0024-efi_stash_loglevel_-efi_set_loglevel.patch

103 lines
3.6 KiB
Diff
Raw Normal View History

2021-11-04 04:50:02 +00:00
From e0ded4593e57657837dfcf110985eabaa37bc492 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Wed, 29 May 2019 10:28:41 -0400
Subject: [PATCH 24/86] efi_stash_loglevel_() -> efi_set_loglevel()
Signed-off-by: Peter Jones <pjones@redhat.com>
---
src/error.c | 8 ++++----
src/include/efivar/efivar.h | 4 ++--
src/libefivar.map.in | 2 +-
src/util.h | 4 ++--
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/error.c b/src/error.c
index a77b0df1feb..083de15e984 100644
--- a/src/error.c
+++ b/src/error.c
@@ -166,13 +166,13 @@ efi_error_pop(void)
static int efi_verbose;
static FILE *efi_errlog, *efi_dbglog;
static int efi_dbglog_fd = -1;
-static int stashed_log_level;
+static int log_level;
static char efi_dbglog_buf[4096];
void PUBLIC
-efi_stash_loglevel_(int level)
+efi_set_loglevel(int level)
{
- stashed_log_level = level;
+ log_level = level;
}
static ssize_t
@@ -181,7 +181,7 @@ dbglog_write(void *cookie UNUSED, const char *buf, size_t size)
FILE *log = efi_errlog ? efi_errlog : stderr;
ssize_t ret = size;
- if (efi_get_verbose() >= stashed_log_level) {
+ if (efi_get_verbose() >= log_level) {
ret = fwrite(buf, 1, size, log);
} else if (efi_dbglog_fd >= 0) {
lseek(efi_dbglog_fd, 0, SEEK_SET);
diff --git a/src/include/efivar/efivar.h b/src/include/efivar/efivar.h
index 11d9a9d7b78..2fdf5b93b29 100644
--- a/src/include/efivar/efivar.h
+++ b/src/include/efivar/efivar.h
@@ -188,7 +188,7 @@ extern int efi_error_set(const char *filename,
__attribute__((__format__ (printf, 5, 6)));
extern void efi_error_clear(void);
extern void efi_error_pop(void);
-extern void efi_stash_loglevel_(int level);
+extern void efi_set_loglevel(int level);
#else
static inline int
__attribute__((__nonnull__ (2, 3, 4, 5, 6)))
@@ -228,7 +228,7 @@ efi_error_pop(void)
}
static inline void
-efi_stash_loglevel_(int level __attribute__((__unused__)))
+efi_set_loglevel(int level __attribute__((__unused__)))
{
return;
}
diff --git a/src/libefivar.map.in b/src/libefivar.map.in
index 33196fefc64..682e622c302 100644
--- a/src/libefivar.map.in
+++ b/src/libefivar.map.in
@@ -133,6 +133,6 @@ LIBEFIVAR_1.37 {
LIBEFIVAR_1.38 {
global: efi_error_pop;
- efi_stash_loglevel_;
+ efi_set_loglevel;
efi_get_libefivar_version;
} LIBEFIVAR_1.37;
diff --git a/src/util.h b/src/util.h
index 337762c9902..ec1c5f1a69a 100644
--- a/src/util.h
+++ b/src/util.h
@@ -382,7 +382,7 @@ swizzle_guid_to_uuid(efi_guid_t *guid)
#define log_(file, line, func, level, fmt, args...) \
({ \
- efi_stash_loglevel_(level); \
+ efi_set_loglevel(level); \
FILE *logfile_ = efi_get_logfile(); \
int len_ = strlen(fmt); \
fprintf(logfile_, "%s:%d %s(): ", \
@@ -401,7 +401,7 @@ swizzle_guid_to_uuid(efi_guid_t *guid)
#define debug(fmt, args...) log(LOG_DEBUG, fmt, ## args)
#define log_hex_(file, line, func, level, buf, size) \
({ \
- efi_stash_loglevel_(level); \
+ efi_set_loglevel(level); \
fhexdumpf(efi_get_logfile(), "%s:%d %s(): ", \
(uint8_t *)buf, size, \
file, line, func); \
--
2.24.1