summaryrefslogtreecommitdiffstats
path: root/src/providers/ad
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2014-10-21 22:36:59 +0200
committerJakub Hrozek <jhrozek@redhat.com>2014-11-05 20:16:24 +0100
commitb95d9cbd6959a3174c4fb963be642f770938e4b7 (patch)
tree418f98bc6d9f4077298ba423a4d1ece315bebc44 /src/providers/ad
parent093ac8b41e4baefd2c1102fb897367318de12fb3 (diff)
downloadsssd-b95d9cbd6959a3174c4fb963be642f770938e4b7.tar.gz
sssd-b95d9cbd6959a3174c4fb963be642f770938e4b7.tar.xz
sssd-b95d9cbd6959a3174c4fb963be642f770938e4b7.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/ad')
-rw-r--r--src/providers/ad/ad_gpo.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/src/providers/ad/ad_gpo.c b/src/providers/ad/ad_gpo.c
index 80b0d45c2..83edbe4fb 100644
--- a/src/providers/ad/ad_gpo.c
+++ b/src/providers/ad/ad_gpo.c
@@ -1313,29 +1313,10 @@ ad_gpo_access_check(TALLOC_CTX *mem_ctx,
}
#define GPO_CHILD_LOG_FILE "gpo_child"
+
static errno_t gpo_child_init(void)
{
- int ret;
- FILE *debug_filep;
-
- if (debug_to_file != 0 && gpo_child_debug_fd == -1) {
- ret = open_debug_file_ex(GPO_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;
- }
-
- gpo_child_debug_fd = fileno(debug_filep);
- if (gpo_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(GPO_CHILD_LOG_FILE, &gpo_child_debug_fd);
}
/*