diff options
author | Roy Marples <roy@marples.name> | 2007-10-04 14:11:45 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2007-10-04 14:11:45 +0000 |
commit | 8b874c9a0f437654ce9dd98c240b5f9cc3989a1e (patch) | |
tree | 7c9ed6e259917d499a8c9fe6c884d59174722e18 | |
parent | 48cfeba8b23fa13fbaf63a27df74d385c6cbbace (diff) |
Revert making function private
-rw-r--r-- | src/librc-daemon.c | 10 | ||||
-rw-r--r-- | src/librc.h | 4 | ||||
-rw-r--r-- | src/rc.h | 10 | ||||
-rw-r--r-- | src/rc.map | 5 | ||||
-rw-r--r-- | src/start-stop-daemon.c | 5 |
5 files changed, 19 insertions, 15 deletions
diff --git a/src/librc-daemon.c b/src/librc-daemon.c index 7e20ab0f..b1734f67 100644 --- a/src/librc-daemon.c +++ b/src/librc-daemon.c @@ -148,7 +148,7 @@ pid_t *rc_find_pids (const char *exec, const char *cmd, librc_hidden_def(rc_find_pids) #elif defined(__DragonFly__) || defined(__FreeBSD__) || \ - defined(__NetBSD__) || defined(__OpenBSD__) + defined(__NetBSD__) || defined(__OpenBSD__) # if defined(__DragonFly__) || defined(__FreeBSD__) # ifndef KERN_PROC_PROC @@ -283,9 +283,9 @@ static bool _match_daemon (const char *path, const char *file, return (m == 111 ? true : false); } -void __rc_service_daemon_set (const char *service, const char *exec, - const char *name, const char *pidfile, - bool started) +void rc_service_daemon_set (const char *service, const char *exec, + const char *name, const char *pidfile, + bool started) { char *svc = rc_xstrdup (service); char *dirpath = rc_strcatpaths (RC_SVCDIR, "daemons", basename (svc), @@ -368,7 +368,7 @@ void __rc_service_daemon_set (const char *service, const char *exec, free (mpidfile); free (dirpath); } -librc_hidden_def(__rc_service_daemon_set) +librc_hidden_def(rc_service_daemon_set) bool rc_service_started_daemon (const char *service, const char *exec, int indx) diff --git a/src/librc.h b/src/librc.h index d9d30d02..efed97f2 100644 --- a/src/librc.h +++ b/src/librc.h @@ -42,7 +42,6 @@ #include <kvm.h> #endif -#include "librc-daemon.h" #include "librc-depend.h" #include "rc.h" #include "rc-misc.h" @@ -80,6 +79,7 @@ librc_hidden_proto(rc_runlevel_starting) librc_hidden_proto(rc_runlevel_stopping) librc_hidden_proto(rc_service_add) librc_hidden_proto(rc_service_daemons_crashed) +librc_hidden_proto(rc_service_daemon_set) librc_hidden_proto(rc_service_delete) librc_hidden_proto(rc_service_description) librc_hidden_proto(rc_service_exists) @@ -116,6 +116,4 @@ librc_hidden_proto(rc_xmalloc) librc_hidden_proto(rc_xrealloc) librc_hidden_proto(rc_xstrdup) -librc_hidden_proto(__rc_service_daemon_set) - #endif @@ -93,6 +93,16 @@ bool rc_service_add (const char *runlevel, const char *service); * @return true if sucessful, otherwise false */ bool rc_service_delete (const char *runlevel, const char *service); +/*! Save the arguments to find a running daemon + * @param service to save arguments for + * @param exec that we started + * @param name of the process (optional) + * @param pidfile of the process (optional) + * @param started if true, add the arguments otherwise remove existing matching arguments */ +void rc_service_daemon_set (const char *service, const char *exec, + const char *name, const char *pidfile, + bool started); + /*! Returns a description of what the service and/or option does. * @param service to check * @param option to check (if NULL, service description) @@ -29,6 +29,7 @@ global: rc_runlevel_stopping; rc_service_add; rc_service_daemons_crashed; + rc_service_daemon_set; rc_service_delete; rc_service_description; rc_service_exists; @@ -68,7 +69,3 @@ global: local: *; }; - -RC_PRIVATE { - __rc_service_daemon_set; -}; diff --git a/src/start-stop-daemon.c b/src/start-stop-daemon.c index f37351f3..8fdcaa33 100644 --- a/src/start-stop-daemon.c +++ b/src/start-stop-daemon.c @@ -46,7 +46,6 @@ static struct pam_conv conv = { NULL, NULL} ; #include "builtins.h" #include "einfo.h" -#include "librc-daemon.h" #include "rc.h" #include "rc-misc.h" #include "strlist.h" @@ -759,7 +758,7 @@ int start_stop_daemon (int argc, char **argv) unlink (pidfile); if (svcname) - __rc_service_daemon_set (svcname, exec, cmd, pidfile, false); + rc_service_daemon_set (svcname, exec, cmd, pidfile, false); exit (EXIT_SUCCESS); } @@ -1033,7 +1032,7 @@ int start_stop_daemon (int argc, char **argv) } if (svcname) - __rc_service_daemon_set (svcname, exec, cmd, pidfile, true); + rc_service_daemon_set (svcname, exec, cmd, pidfile, true); exit (EXIT_SUCCESS); } |