summaryrefslogtreecommitdiff
path: root/src/librc.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-12-05 17:48:07 +0000
committerRoy Marples <roy@marples.name>2007-12-05 17:48:07 +0000
commit0490a9290a6af4a4923cc79fd380bc00a0a702e3 (patch)
tree5848bf69e4dc0357cc092ed30c974d20154c6469 /src/librc.c
parentf40f7528be64269af7a5401af95dd37d398a5b31 (diff)
downloadopenrc-0490a9290a6af4a4923cc79fd380bc00a0a702e3.tar.gz
openrc-0490a9290a6af4a4923cc79fd380bc00a0a702e3.tar.bz2
openrc-0490a9290a6af4a4923cc79fd380bc00a0a702e3.tar.xz
Remove rc_service_wait as runscript.c should do the waiting. rc_deptree_depend now returns the exact depends as listed. This is so we can support a new 'keywords' directive. We can add whatever here, like 'notimeout' which means that an init script doesn't timeout. This removes the hardcoded check on checkfs and checkroot.
Diffstat (limited to 'src/librc.c')
-rw-r--r--src/librc.c54
1 files changed, 0 insertions, 54 deletions
diff --git a/src/librc.c b/src/librc.c
index 0fdf6e0..e429318 100644
--- a/src/librc.c
+++ b/src/librc.c
@@ -35,14 +35,6 @@ const char copyright[] = "Copyright (c) 2007 Gentoo Foundation\n"
#include "librc.h"
-/* usecs to wait while we poll the fifo */
-#define WAIT_INTERVAL 20000000
-
-/* max secs to wait until a service comes up */
-#define WAIT_MAX 300
-
-#define ONE_SECOND 1000000000
-
#define SOFTLEVEL RC_SVCDIR "/softlevel"
#ifndef S_IXUGO
@@ -719,52 +711,6 @@ bool rc_service_schedule_clear (const char *service)
}
librc_hidden_def(rc_service_schedule_clear)
-bool rc_service_wait (const char *service)
-{
- char *svc;
- char *base;
- char *fifo;
- struct timespec ts;
- int nloops = WAIT_MAX * (ONE_SECOND / WAIT_INTERVAL);
- bool retval = false;
- bool forever = false;
-
- if (! service)
- return (false);
-
- svc = xstrdup (service);
- base = basename (svc);
- fifo = rc_strcatpaths (RC_SVCDIR, "exclusive", base, (char *) NULL);
- /* FIXME: find a better way of doing this
- * Maybe a setting in the init script? */
- if (strcmp (base, "checkfs") == 0 || strcmp (base, "checkroot") == 0)
- forever = true;
- free (svc);
-
- ts.tv_sec = 0;
- ts.tv_nsec = WAIT_INTERVAL;
-
- while (nloops) {
- if (! exists (fifo)) {
- retval = true;
- break;
- }
-
- if (nanosleep (&ts, NULL) == -1) {
- if (errno != EINTR)
- break;
- }
-
- if (! forever)
- nloops --;
- }
-
- if (! exists (fifo))
- retval = true;
- free (fifo);
- return (retval);
-}
-librc_hidden_def(rc_service_wait)
char **rc_services_in_runlevel (const char *runlevel)
{