mirror of
https://src.fedoraproject.org/rpms/grub2.git
synced 2024-11-28 15:46:53 +00:00
1713515a59
Signed-off-by: Peter Jones <pjones@redhat.com>
59 lines
1.8 KiB
Diff
59 lines
1.8 KiB
Diff
From 5e50fc35ba1c2f03cc9ccbd6ae2f49dcb0ffd560 Mon Sep 17 00:00:00 2001
|
|
From: Peter Jones <pjones@redhat.com>
|
|
Date: Sun, 28 Jun 2015 13:09:58 -0400
|
|
Subject: [PATCH 10004/10006] Add grub_qdprintf() - grub_dprintf() without the
|
|
file+line number.
|
|
|
|
This just makes copy+paste of our debug loading info easier.
|
|
|
|
Signed-off-by: Peter Jones <pjones@redhat.com>
|
|
---
|
|
grub-core/kern/misc.c | 18 ++++++++++++++++++
|
|
include/grub/misc.h | 2 ++
|
|
2 files changed, 20 insertions(+)
|
|
|
|
diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c
|
|
index d7dcd97..8e12a62 100644
|
|
--- a/grub-core/kern/misc.c
|
|
+++ b/grub-core/kern/misc.c
|
|
@@ -179,6 +179,24 @@ grub_real_dprintf (const char *file, const int line, const char *condition,
|
|
}
|
|
}
|
|
|
|
+void
|
|
+grub_qdprintf (const char *condition, const char *fmt, ...)
|
|
+{
|
|
+ va_list args;
|
|
+ const char *debug = grub_env_get ("debug");
|
|
+
|
|
+ if (! debug)
|
|
+ return;
|
|
+
|
|
+ if (grub_strword (debug, "all") || grub_strword (debug, condition))
|
|
+ {
|
|
+ va_start (args, fmt);
|
|
+ grub_vprintf (fmt, args);
|
|
+ va_end (args);
|
|
+ grub_refresh ();
|
|
+ }
|
|
+}
|
|
+
|
|
#define PREALLOC_SIZE 255
|
|
|
|
int
|
|
diff --git a/include/grub/misc.h b/include/grub/misc.h
|
|
index 0620814..4cb1ba5 100644
|
|
--- a/include/grub/misc.h
|
|
+++ b/include/grub/misc.h
|
|
@@ -326,6 +326,8 @@ void EXPORT_FUNC(grub_real_dprintf) (const char *file,
|
|
const int line,
|
|
const char *condition,
|
|
const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 4, 5)));
|
|
+void EXPORT_FUNC(grub_qdprintf) (const char *condition,
|
|
+ const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 2, 3)));
|
|
int EXPORT_FUNC(grub_vprintf) (const char *fmt, va_list args);
|
|
int EXPORT_FUNC(grub_snprintf) (char *str, grub_size_t n, const char *fmt, ...)
|
|
__attribute__ ((format (GNU_PRINTF, 3, 4)));
|
|
--
|
|
2.5.0
|
|
|