From 50668161ad45b5b7b3a7e9e942bc8e765b9de4be Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Fri, 13 Jan 2017 07:55:44 +0100 Subject: [PATCH] Move do_sleep() from helper.c --> util.c This move makes it possible to share the code between the Finit daemon and its client tools. Signed-off-by: Joachim Nilsson --- helpers.c | 7 ------- helpers.h | 1 - util.c | 7 +++++++ util.h | 1 + 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/helpers.c b/helpers.c index cc601aa5..2037b488 100644 --- a/helpers.c +++ b/helpers.c @@ -248,13 +248,6 @@ int getgroup(char *group) #endif } -/* Signal safe sleep ... we get a lot of SIGCHLD at reboot */ -void do_sleep(unsigned int sec) -{ - while ((sec = sleep(sec))) - ; -} - void set_hostname(char **hostname) { FILE *fp; diff --git a/helpers.h b/helpers.h index e3e3e8f4..dcfae8c5 100644 --- a/helpers.h +++ b/helpers.h @@ -63,7 +63,6 @@ int print_result (int fail); void logit (int prio, const char *fmt, ...); int start_process (char *cmd, char *args[], int console); -void do_sleep (unsigned int sec); int getuser (char *username, char **home); int getgroup (char *group); void set_hostname (char **hostname); diff --git a/util.c b/util.c index 9ed4efba..41d5aef7 100644 --- a/util.c +++ b/util.c @@ -36,6 +36,13 @@ char *progname(char *arg0) return prognm; } +void do_sleep(unsigned int sec) +{ + while ((sec = sleep(sec))) + ; +} + + /** * Local Variables: * indent-tabs-mode: t diff --git a/util.h b/util.h index 8305eb2d..9aefd2b2 100644 --- a/util.h +++ b/util.h @@ -27,6 +27,7 @@ extern char *prognm; char *progname(char *arg0); +void do_sleep(unsigned int sec); #endif /* FINIT_UTIL_H_ */