efivar/0019-Fix-dbglog_seek-to-update-the-offset.patch

33 lines
775 B
Diff
Raw Normal View History

From b90e0e1722ce442aec747e8d2b77dec4c05d6069 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Wed, 29 May 2019 09:28:50 -0400
Subject: [PATCH 19/63] Fix dbglog_seek() to update the offset.
Signed-off-by: Peter Jones <pjones@redhat.com>
---
src/error.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/error.c b/src/error.c
index 5dc43197c50..5eaee84599a 100644
--- a/src/error.c
+++ b/src/error.c
@@ -194,7 +194,13 @@ static int
dbglog_seek(void *cookie UNUSED, off64_t *offset, int whence)
{
FILE *log = efi_errlog ? efi_errlog : stderr;
- return fseek(log, *offset, whence);
+ int rc;
+
+ rc = fseek(log, *offset, whence);
+ if (rc < 0)
+ return rc;
+ *offset = ftell(log);
+ return 0;
}
static int
--
2.26.2