From 924f443d62bfabf8761da31ed890791d5893463a Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 5 May 2024 17:56:50 +0200 Subject: Remove libexec_init_command, doc stuff, make functions inline, and fix a bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit libexec_init_command was a huge oversight, it cannot be used as it would set .library_version to the libraries version of LIBEXEC_VERSION rather than the application's; instead LIBEXEC_COMMAND_INIT should be used. Signed-off-by: Mattias Andrée --- LIBEXEC_COMMAND_INIT.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 LIBEXEC_COMMAND_INIT.c (limited to 'LIBEXEC_COMMAND_INIT.c') diff --git a/LIBEXEC_COMMAND_INIT.c b/LIBEXEC_COMMAND_INIT.c new file mode 100644 index 0000000..e211995 --- /dev/null +++ b/LIBEXEC_COMMAND_INIT.c @@ -0,0 +1,28 @@ +/* See LICENSE file for copyright and license details. */ +#include "common.h" +#ifdef TEST + + +int +main(void) +{ + struct libexec_command cmd; + + memset(&cmd, 127, sizeof(cmd)); + cmd = LIBEXEC_COMMAND_INIT; + + ASSERT_EQ_INT(cmd.library_version, LIBEXEC_VERSION); + ASSERT_EQ_ENUM(cmd.exec_how, LIBEXEC_ALLOW_NAME); + ASSERT_EQ_INT(cmd.exec_fd, -1); + ASSERT_IS_NULL(cmd.executable); + ASSERT_IS_NULL(cmd.arguments); + ASSERT_EQ_UINT(cmd.narguments, 0); + ASSERT_IS_NULL(cmd.plumings); + ASSERT_EQ_UINT(cmd.nplumings, 0); + ASSERT_IS_NULL(cmd.environ); + + return 0; +} + + +#endif -- cgit v1.2.3-70-g09d2