diff options
author | Mattias Andrée <maandree@kth.se> | 2024-05-05 17:56:50 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2024-05-05 17:59:12 +0200 |
commit | 924f443d62bfabf8761da31ed890791d5893463a (patch) | |
tree | aa544535fca95a653844aea8d233b2450246d88a /LIBEXEC_COMMAND_INIT.c | |
parent | First commit (diff) | |
download | libexec-924f443d62bfabf8761da31ed890791d5893463a.tar.gz libexec-924f443d62bfabf8761da31ed890791d5893463a.tar.bz2 libexec-924f443d62bfabf8761da31ed890791d5893463a.tar.xz |
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 <maandree@kth.se>
Diffstat (limited to 'LIBEXEC_COMMAND_INIT.c')
-rw-r--r-- | LIBEXEC_COMMAND_INIT.c | 28 |
1 files changed, 28 insertions, 0 deletions
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 |