aboutsummaryrefslogtreecommitdiff
path: root/lib/src/delsvc.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@tele2.at>2018-04-04 14:58:01 +0200
committerDavid Oberhollenzer <david.oberhollenzer@tele2.at>2018-04-04 14:58:01 +0200
commit04a23330e4a2085ee91980c223c5e4f089ebbe97 (patch)
treeda0b02615fb21849a37cf4632c80df1569788dff /lib/src/delsvc.c
parentaa1356cb190a3416936b25f75ecaaa8684c6fcde (diff)
Merge preprocessing of command lines
- Common function for splitting string into argument vector - Preprocess & split command lines while parsing the service file - Specify "before" and "after" dependencies in a single line Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
Diffstat (limited to 'lib/src/delsvc.c')
-rw-r--r--lib/src/delsvc.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/src/delsvc.c b/lib/src/delsvc.c
index 3e077fb..7370653 100644
--- a/lib/src/delsvc.c
+++ b/lib/src/delsvc.c
@@ -21,16 +21,19 @@
void delsvc(service_t *svc)
{
- size_t i;
+ exec_t *e;
- for (i = 0; i < svc->num_exec; ++i)
- free(svc->exec[i]);
+ while (svc->exec != NULL) {
+ e = svc->exec;
+ svc->exec = e->next;
- for (i = 0; i < svc->num_before; ++i)
- free(svc->before[i]);
+ free(e->argv);
+ free(e->raw_argv);
+ free(e);
+ }
- for (i = 0; i < svc->num_after; ++i)
- free(svc->after[i]);
+ free(svc->raw_before);
+ free(svc->raw_after);
free(svc->before);
free(svc->after);