98 lines
3.4 KiB
Diff
98 lines
3.4 KiB
Diff
From f468d11fce4257bf3acc07b7f5a8d45cfbe52a60 Mon Sep 17 00:00:00 2001
|
|
From: Lukas Slebodnik <lslebodn@redhat.com>
|
|
Date: Mon, 11 Jan 2016 18:54:40 +0100
|
|
Subject: [PATCH 69/86] UTIL: Use prefix for debug function
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
|
|
(cherry picked from commit 2a44a8c6683cfea218ee5329bcfad953dfeb6746)
|
|
(cherry picked from commit 4772bb86902552cb2fc18c3127b74f8cde5252ea)
|
|
---
|
|
src/util/debug.c | 12 ++++++------
|
|
src/util/sss_semanage.c | 2 +-
|
|
src/util/util.h | 16 ++++++++--------
|
|
3 files changed, 15 insertions(+), 15 deletions(-)
|
|
|
|
diff --git a/src/util/debug.c b/src/util/debug.c
|
|
index b6ab368db824bbd297dcb410c3e669d911ff0d33..570c80273c0bdda1cc8df0e6af825595cfa339e0 100644
|
|
--- a/src/util/debug.c
|
|
+++ b/src/util/debug.c
|
|
@@ -206,11 +206,11 @@ journal_done:
|
|
}
|
|
#endif /* WiTH_JOURNALD */
|
|
|
|
-void debug_fn(const char *file,
|
|
- long line,
|
|
- const char *function,
|
|
- int level,
|
|
- const char *format, ...)
|
|
+void sss_debug_fn(const char *file,
|
|
+ long line,
|
|
+ const char *function,
|
|
+ int level,
|
|
+ const char *format, ...)
|
|
{
|
|
va_list ap;
|
|
struct timeval tv;
|
|
@@ -301,7 +301,7 @@ void ldb_debug_messages(void *context, enum ldb_debug_level level,
|
|
}
|
|
|
|
if (DEBUG_IS_SET(loglevel))
|
|
- debug_fn(__FILE__, __LINE__, "ldb", loglevel, "%s\n", message);
|
|
+ sss_debug_fn(__FILE__, __LINE__, "ldb", loglevel, "%s\n", message);
|
|
|
|
free(message);
|
|
}
|
|
diff --git a/src/util/sss_semanage.c b/src/util/sss_semanage.c
|
|
index d1d03988c05dc011dbd465051d50fe6acca4f845..4fb9df589bbfddcc815ed321b6e3b32655d44a0c 100644
|
|
--- a/src/util/sss_semanage.c
|
|
+++ b/src/util/sss_semanage.c
|
|
@@ -64,7 +64,7 @@ static void sss_semanage_error_callback(void *varg,
|
|
}
|
|
|
|
if (DEBUG_IS_SET(level))
|
|
- debug_fn(__FILE__, __LINE__, "libsemanage", level, "%s\n", message);
|
|
+ sss_debug_fn(__FILE__, __LINE__, "libsemanage", level, "%s\n", message);
|
|
free(message);
|
|
}
|
|
|
|
diff --git a/src/util/util.h b/src/util/util.h
|
|
index c0db6779f7f6fae44a5d956ae52a166f0f4eefc6..0b50d5abf6f1651dcf350e2c235702b5a21536d1 100644
|
|
--- a/src/util/util.h
|
|
+++ b/src/util/util.h
|
|
@@ -71,11 +71,11 @@ extern int debug_microseconds;
|
|
extern int debug_to_file;
|
|
extern int debug_to_stderr;
|
|
extern const char *debug_log_file;
|
|
-void debug_fn(const char *file,
|
|
- long line,
|
|
- const char *function,
|
|
- int level,
|
|
- const char *format, ...) SSS_ATTRIBUTE_PRINTF(5,6);
|
|
+void sss_debug_fn(const char *file,
|
|
+ long line,
|
|
+ const char *function,
|
|
+ int level,
|
|
+ const char *format, ...) SSS_ATTRIBUTE_PRINTF(5, 6);
|
|
int debug_convert_old_level(int old_level);
|
|
errno_t set_debug_file_from_fd(const int fd);
|
|
int get_fd_from_debug_file(void);
|
|
@@ -129,9 +129,9 @@ int get_fd_from_debug_file(void);
|
|
#define DEBUG(level, format, ...) do { \
|
|
int __debug_macro_level = level; \
|
|
if (DEBUG_IS_SET(__debug_macro_level)) { \
|
|
- debug_fn(__FILE__, __LINE__, __FUNCTION__, \
|
|
- __debug_macro_level, \
|
|
- format, ##__VA_ARGS__); \
|
|
+ sss_debug_fn(__FILE__, __LINE__, __FUNCTION__, \
|
|
+ __debug_macro_level, \
|
|
+ format, ##__VA_ARGS__); \
|
|
} \
|
|
} while (0)
|
|
|
|
--
|
|
2.5.0
|
|
|