diff options
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/sss_userdel.c | 8 | ||||
-rw-r--r-- | src/tools/tools_util.c | 11 |
2 files changed, 9 insertions, 10 deletions
diff --git a/src/tools/sss_userdel.c b/src/tools/sss_userdel.c index 2cf77596..ac87a736 100644 --- a/src/tools/sss_userdel.c +++ b/src/tools/sss_userdel.c @@ -101,15 +101,15 @@ static int kick_user(struct tools_ctx *tctx) } while((child_pid = waitpid(pid, &status, 0)) > 0) { - if (child_pid == -1) { - DEBUG(1, ("waitpid failed\n")); - return errno; - } if (WIFEXITED(status)) { break; } } + if (child_pid == -1) { + DEBUG(SSSDBG_CRIT_FAILURE, ("waitpid failed\n")); + return errno; + } } return EOK; diff --git a/src/tools/tools_util.c b/src/tools/tools_util.c index 85164c61..1ad5326e 100644 --- a/src/tools/tools_util.c +++ b/src/tools/tools_util.c @@ -538,12 +538,6 @@ int run_userdel_cmd(struct tools_ctx *tctx) } while((child_pid = waitpid(pid, &status, 0)) > 0) { - if (child_pid == -1) { - DEBUG(1, ("waitpid failed\n")); - ret = errno; - goto done; - } - if (WIFEXITED(status)) { ret = WEXITSTATUS(status); if (ret != 0) { @@ -567,6 +561,11 @@ int run_userdel_cmd(struct tools_ctx *tctx) goto done; } } + if (child_pid == -1) { + DEBUG(SSSDBG_CRIT_FAILURE, ("waitpid failed\n")); + ret = errno; + goto done; + } } ret = EOK; |