diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2015-01-07 10:36:12 +0100 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2015-01-13 17:45:19 +0100 |
commit | 16cb0969f0a9ea71524d852077d6a480740d4f12 (patch) | |
tree | e9783c109010476b0c795cd55e76de60f9b2268f /src/tests | |
parent | bb7ddd2be9847bfb07395341c7623da1b104b8a6 (diff) | |
download | sssd-16cb0969f0a9ea71524d852077d6a480740d4f12.tar.gz sssd-16cb0969f0a9ea71524d852077d6a480740d4f12.tar.xz sssd-16cb0969f0a9ea71524d852077d6a480740d4f12.zip |
UTIL: Allow dup-ing child pipe to a different FD
Related to:
https://fedorahosted.org/sssd/ticket/2544
Adds a new function exec_child_ex and moves setting the extra_argv[]
to exec_child_ex() along with specifying the input and output fds.
Reviewed-by: Sumit Bose <sbose@redhat.com>
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/cmocka/test_child_common.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/tests/cmocka/test_child_common.c b/src/tests/cmocka/test_child_common.c index ee6e297f5..23e14ce49 100644 --- a/src/tests/cmocka/test_child_common.c +++ b/src/tests/cmocka/test_child_common.c @@ -89,7 +89,7 @@ void test_exec_child(void **state) ret = exec_child(child_tctx, child_tctx->pipefd_to_child, child_tctx->pipefd_from_child, - CHILD_DIR"/"TEST_BIN, 2, NULL); + CHILD_DIR"/"TEST_BIN, 2); assert_int_equal(ret, EOK); } else { do { @@ -128,10 +128,11 @@ void test_exec_child_extra_args(void **state) child_pid = fork(); assert_int_not_equal(child_pid, -1); if (child_pid == 0) { - ret = exec_child(child_tctx, - child_tctx->pipefd_to_child, - child_tctx->pipefd_from_child, - CHILD_DIR"/"TEST_BIN, 2, extra_args); + ret = exec_child_ex(child_tctx, + child_tctx->pipefd_to_child, + child_tctx->pipefd_from_child, + CHILD_DIR"/"TEST_BIN, 2, extra_args, + STDIN_FILENO, STDOUT_FILENO); assert_int_equal(ret, EOK); } else { do { |