diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2014-10-21 22:36:59 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-11-05 19:55:09 +0100 |
commit | 77b13371c87702aee3f858f6b2b73826cf5a01bd (patch) | |
tree | 11fbb98aa528b9e35a1718b7a6f8e7fd2f0b03a7 /src/providers/ldap | |
parent | 06f10b2a0ebb26f2460cd445f8040e9205de7500 (diff) | |
download | sssd-77b13371c87702aee3f858f6b2b73826cf5a01bd.tar.gz sssd-77b13371c87702aee3f858f6b2b73826cf5a01bd.tar.xz sssd-77b13371c87702aee3f858f6b2b73826cf5a01bd.zip |
UTIL: Remove more code duplication setting up child processes
All our child processes duplicated the same code that set up the
debugging all around. Instead of adding yet another copy for the
selinux_child, add a common utility function.
Reviewed-by: Michal Židek <mzidek@redhat.com>
Diffstat (limited to 'src/providers/ldap')
-rw-r--r-- | src/providers/ldap/sdap_child_helpers.c | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/src/providers/ldap/sdap_child_helpers.c b/src/providers/ldap/sdap_child_helpers.c index e5d46b9b7..400109890 100644 --- a/src/providers/ldap/sdap_child_helpers.c +++ b/src/providers/ldap/sdap_child_helpers.c @@ -466,25 +466,5 @@ static errno_t set_tgt_child_timeout(struct tevent_req *req, /* Setup child logging */ int sdap_setup_child(void) { - int ret; - FILE *debug_filep; - - if (debug_to_file != 0 && ldap_child_debug_fd == -1) { - ret = open_debug_file_ex(LDAP_CHILD_LOG_FILE, &debug_filep, false); - if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, "Error setting up logging (%d) [%s]\n", - ret, strerror(ret)); - return ret; - } - - ldap_child_debug_fd = fileno(debug_filep); - if (ldap_child_debug_fd == -1) { - DEBUG(SSSDBG_FATAL_FAILURE, - "fileno failed [%d][%s]\n", errno, strerror(errno)); - ret = errno; - return ret; - } - } - - return EOK; + return child_debug_init(LDAP_CHILD_LOG_FILE, &ldap_child_debug_fd); } |