From 87a524d9313428d55e5a04c2538042629bdc467a Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Tue, 31 Mar 2020 18:19:27 +0200 Subject: cleanup: delete remains of libutil - exec_t belongs to service.h, the main place where it is used/needed - code for executing exec_t is moved to runsvc for the same reason - what is left are NORETURN and ARRAY_SIZE - the former can be replaced with direct attribute usage since the only relevant compilers all support the attribute. - the later is only used in 3 places and can be trivially replaced with direct usage of sizeof(). Signed-off-by: David Oberhollenzer --- lib/include/service.h | 6 +++++- lib/include/util.h | 28 ---------------------------- 2 files changed, 5 insertions(+), 29 deletions(-) delete mode 100644 lib/include/util.h (limited to 'lib/include') diff --git a/lib/include/service.h b/lib/include/service.h index cc01c5d..a05c7ee 100644 --- a/lib/include/service.h +++ b/lib/include/service.h @@ -4,7 +4,11 @@ #include -#include "util.h" +typedef struct exec_t { + struct exec_t *next; + int argc; /* number of elements in argument vector */ + char args[]; /* argument vectot string blob */ +} exec_t; enum { /* diff --git a/lib/include/util.h b/lib/include/util.h deleted file mode 100644 index efd89fc..0000000 --- a/lib/include/util.h +++ /dev/null @@ -1,28 +0,0 @@ -/* SPDX-License-Identifier: ISC */ -#ifndef UTIL_H -#define UTIL_H - -#include -#include -#include -#include - -#include "config.h" - -#ifdef __GNUC__ - #define NORETURN __attribute__((noreturn)) -#endif - -#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) - -typedef struct exec_t { - struct exec_t *next; - int argc; /* number of elements in argument vector */ - char args[]; /* argument vectot string blob */ -} exec_t; - -int setup_tty(const char *tty, bool truncate); - -NORETURN void argv_exec(exec_t *e); - -#endif /* UTIL_H */ -- cgit v1.2.3