summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@tele2.at>2018-11-04 14:27:28 +0100
committerDavid Oberhollenzer <david.oberhollenzer@tele2.at>2018-11-04 14:30:16 +0100
commit34f542b7cc6e84403326acf145487a7d83175a11 (patch)
treef63accb7d3f22e5cae61dcdeb3b65add403d28cf /lib
parent1ffc240b3f7668ff2fb4e72b6e15937824a6cf3e (diff)
Seperate init specific code from utility code
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
Diffstat (limited to 'lib')
-rw-r--r--lib/Makemodule.am16
-rw-r--r--lib/include/service.h10
-rw-r--r--lib/include/util.h10
-rw-r--r--lib/init/del_svc_list.c (renamed from lib/util/del_svc_list.c)0
-rw-r--r--lib/init/delsvc.c (renamed from lib/util/delsvc.c)0
-rw-r--r--lib/init/opensock.c (renamed from lib/util/opensock.c)0
-rw-r--r--lib/init/rdsvc.c (renamed from lib/util/rdsvc.c)0
-rw-r--r--lib/init/svc_tsort.c (renamed from lib/util/svc_tsort.c)0
-rw-r--r--lib/init/svcmap.c (renamed from lib/util/svcmap.c)0
-rw-r--r--lib/init/svcscan.c (renamed from lib/util/svcscan.c)0
10 files changed, 20 insertions, 16 deletions
diff --git a/lib/Makemodule.am b/lib/Makemodule.am
index 51bce72..66652bc 100644
--- a/lib/Makemodule.am
+++ b/lib/Makemodule.am
@@ -1,13 +1,17 @@
HEADRS = lib/include/util.h lib/include/service.h lib/include/telinit.h
-libinit_a_SOURCES = lib/util/delsvc.c lib/util/svcmap.c lib/util/enum_by_name.c
-libinit_a_SOURCES += lib/util/rdsvc.c lib/util/svcscan.c lib/util/mksock.c
-libinit_a_SOURCES += lib/util/del_svc_list.c lib/util/svc_tsort.c
-libinit_a_SOURCES += lib/util/opensock.c lib/util/enum_to_name.c
-libinit_a_SOURCES += lib/util/print_version.c lib/util/argv_exec.c $(HEADRS)
+libinit_a_SOURCES = lib/init/delsvc.c lib/init/svcmap.c lib/init/rdsvc.c
+libinit_a_SOURCES += lib/init/svcscan.c lib/init/del_svc_list.c
+libinit_a_SOURCES += lib/init/svc_tsort.c lib/init/opensock.c $(HEADRS)
libinit_a_CPPFLAGS = $(AM_CPPFLAGS)
libinit_a_CFLAGS = $(AM_CFLAGS)
+libutil_a_SOURCES = lib/util/argv_exec.c lib/util/enum_by_name.c
+libutil_a_SOURCES += lib/util/enum_to_name.c lib/util/mksock.c
+libutil_a_SOURCES += lib/util/print_version.c $(HEADRS)
+libutil_a_CPPFLAGS = $(AM_CPPFLAGS)
+libutil_a_CFLAGS = $(AM_CFLAGS)
+
libcfg_a_SOURCES = lib/libcfg/rdline.c lib/libcfg/unescape.c lib/libcfg/rdcfg.c
libcfg_a_SOURCES += lib/libcfg/pack_argv.c lib/include/libcfg.h
libcfg_a_CPPFLAGS = $(AM_CPPFLAGS)
@@ -20,4 +24,4 @@ libcron_a_CFLAGS = $(AM_CFLAGS)
EXTRA_DIST += $(HEADRS) lib/include/libcfg.h lib/include/crontab.h
-noinst_LIBRARIES += libinit.a libcfg.a libcron.a
+noinst_LIBRARIES += libinit.a libcfg.a libcron.a libutil.a
diff --git a/lib/include/service.h b/lib/include/service.h
index abe4968..ca96e58 100644
--- a/lib/include/service.h
+++ b/lib/include/service.h
@@ -57,12 +57,6 @@ enum {
SVC_FLAG_TRUNCATE_OUT = 0x01,
};
-typedef struct exec_t {
- struct exec_t *next;
- int argc; /* number of elements in argument vector */
- char args[]; /* argument vectot string blob */
-} exec_t;
-
typedef struct service_t {
struct service_t *next;
@@ -125,9 +119,5 @@ const char *svc_target_to_string(int target);
int svc_target_from_string(const char *target);
-int setup_tty(const char *tty, bool truncate);
-
-NORETURN void argv_exec(exec_t *e);
-
#endif /* SERVICE_H */
diff --git a/lib/include/util.h b/lib/include/util.h
index 6d2bf5d..925a1f0 100644
--- a/lib/include/util.h
+++ b/lib/include/util.h
@@ -35,6 +35,12 @@ typedef struct {
int value;
} enum_map_t;
+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 {
/* only allow root to connect */
SOCK_FLAG_ROOT_ONLY = 0x01,
@@ -73,5 +79,9 @@ int mksock(const char *path, int flags);
/* print a default version info and license string */
NORETURN void print_version(const char *program);
+int setup_tty(const char *tty, bool truncate);
+
+NORETURN void argv_exec(exec_t *e);
+
#endif /* UTIL_H */
diff --git a/lib/util/del_svc_list.c b/lib/init/del_svc_list.c
index 553a701..553a701 100644
--- a/lib/util/del_svc_list.c
+++ b/lib/init/del_svc_list.c
diff --git a/lib/util/delsvc.c b/lib/init/delsvc.c
index 9ab51f1..9ab51f1 100644
--- a/lib/util/delsvc.c
+++ b/lib/init/delsvc.c
diff --git a/lib/util/opensock.c b/lib/init/opensock.c
index 0c2bf56..0c2bf56 100644
--- a/lib/util/opensock.c
+++ b/lib/init/opensock.c
diff --git a/lib/util/rdsvc.c b/lib/init/rdsvc.c
index ca60731..ca60731 100644
--- a/lib/util/rdsvc.c
+++ b/lib/init/rdsvc.c
diff --git a/lib/util/svc_tsort.c b/lib/init/svc_tsort.c
index 5f83fa0..5f83fa0 100644
--- a/lib/util/svc_tsort.c
+++ b/lib/init/svc_tsort.c
diff --git a/lib/util/svcmap.c b/lib/init/svcmap.c
index 41fb950..41fb950 100644
--- a/lib/util/svcmap.c
+++ b/lib/init/svcmap.c
diff --git a/lib/util/svcscan.c b/lib/init/svcscan.c
index f4c7ef1..f4c7ef1 100644
--- a/lib/util/svcscan.c
+++ b/lib/init/svcscan.c