diff options
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/debug.c | 9 | ||||
-rw-r--r-- | src/util/util.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/util/debug.c b/src/util/debug.c index 3121c70b1..bf83624c9 100644 --- a/src/util/debug.c +++ b/src/util/debug.c @@ -70,6 +70,15 @@ errno_t set_debug_file_from_fd(const int fd) return EOK; } +int get_fd_from_debug_file(void) +{ + if (debug_file == NULL) { + return STDERR_FILENO; + } + + return fileno(debug_file); +} + int debug_convert_old_level(int old_level) { if ((old_level != 0) && !(old_level & 0x000F)) diff --git a/src/util/util.h b/src/util/util.h index 704e10dc6..d831d533f 100644 --- a/src/util/util.h +++ b/src/util/util.h @@ -78,6 +78,7 @@ void debug_fn(const char *file, 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); #define SSS_DOM_ENV "_SSS_DOM" |