diff options
author | Roy Marples <roy@marples.name> | 2008-02-28 11:08:49 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2008-02-28 11:08:49 +0000 |
commit | f092045650faad778d25d000d80b3128664d2e2a (patch) | |
tree | 89188e92a4d01423ee59e33e5eaf5355fa14d103 /src/librc/librc.c | |
parent | aabf3976db5ffb41f8f8bbd47f5015b4158e095a (diff) |
Support the use of PREFIX and PKG_PREFIX.
Diffstat (limited to 'src/librc/librc.c')
-rw-r--r-- | src/librc/librc.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/librc/librc.c b/src/librc/librc.c index 12d31348..552e083d 100644 --- a/src/librc/librc.c +++ b/src/librc/librc.c @@ -328,11 +328,13 @@ char *rc_service_resolve (const char *service) snprintf (buffer, sizeof (buffer), RC_INITDIR "/%s", service); /* So we don't exist in /etc/init.d - check /usr/local/etc/init.d */ +#ifdef RC_PKG_INITDIR if (stat (buffer, &buf) != 0) { - snprintf (buffer, sizeof (buffer), RC_INITDIR_LOCAL "/%s", service); + snprintf (buffer, sizeof (buffer), RC_PKG_INITDIR "/%s", service); if (stat (buffer, &buf) != 0) return (NULL); } +#endif return (xstrdup (buffer)); } @@ -781,12 +783,18 @@ char **rc_services_in_runlevel (const char *runlevel) if (! runlevel) { int i; - char **local = ls_dir (RC_INITDIR_LOCAL, LS_INITD); +#ifdef RC_PKG_INITDIR + char **local = ls_dir (RC_PKG_INITDIR, LS_INITD); +#endif list = ls_dir (RC_INITDIR, LS_INITD); + +#ifdef RC_PKG_INITDIR STRLIST_FOREACH (local, dir, i) rc_strlist_addsortu (&list, dir); rc_strlist_free (local); +#endif + return (list); } |