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