diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2015-04-08 14:29:05 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2015-04-14 11:35:31 +0200 |
commit | 843a66170a4e51e0a614498e74f3526afc4bff52 (patch) | |
tree | d7ddeb255596ce045ba0b50500256039fd31a0cb /src/util/debug.c | |
parent | c526cd124515cc2d44a413dcbfd4a74ddb490150 (diff) | |
download | sssd-843a66170a4e51e0a614498e74f3526afc4bff52.tar.gz sssd-843a66170a4e51e0a614498e74f3526afc4bff52.tar.xz sssd-843a66170a4e51e0a614498e74f3526afc4bff52.zip |
UTIL: Add a simple function to get the fd of debug_file
Reviewed-by: Pavel Reichl <preichl@redhat.com>
Diffstat (limited to 'src/util/debug.c')
-rw-r--r-- | src/util/debug.c | 9 |
1 files changed, 9 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)) |