summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-03-19 19:57:24 +0000
committerRoy Marples <roy@marples.name>2008-03-19 19:57:24 +0000
commit6159a32f39afc60d88602cc796cef6a395bb78bf (patch)
tree6b2471081a475c0c42b41bd7aca6a1a0e8fcdbe6 /src
parent6d2e1f7addcf5ff6594d381845708229086d8d96 (diff)
downloadopenrc-6159a32f39afc60d88602cc796cef6a395bb78bf.tar.gz
openrc-6159a32f39afc60d88602cc796cef6a395bb78bf.tar.bz2
openrc-6159a32f39afc60d88602cc796cef6a395bb78bf.tar.xz
SVCNAME -> RC_SVCNAME, but export SVCNAME still for compat.
Diffstat (limited to 'src')
-rw-r--r--src/rc/rc-applets.c10
-rw-r--r--src/rc/runscript.c2
-rw-r--r--src/rc/start-stop-daemon.c7
3 files changed, 10 insertions, 9 deletions
diff --git a/src/rc/rc-applets.c b/src/rc/rc-applets.c
index 821832c..42f839f 100644
--- a/src/rc/rc-applets.c
+++ b/src/rc/rc-applets.c
@@ -207,7 +207,7 @@ static int do_service(int argc, char **argv)
if (argc > 1)
service = argv[1];
else
- service = getenv("SVCNAME");
+ service = getenv("RC_SVCNAME");
if (! service || *service == '\0')
eerrorx("%s: no service specified", applet);
@@ -229,7 +229,7 @@ static int do_service(int argc, char **argv)
else if (strcmp(applet, "service_started_daemon") == 0) {
d[0] = argv[1];
- service = getenv("SVCNAME");
+ service = getenv("RC_SVCNAME");
if (argc > 3) {
service = argv[1];
d[0] = argv[2];
@@ -252,7 +252,7 @@ static int do_service(int argc, char **argv)
static int do_mark_service(int argc, char **argv)
{
bool ok = false;
- char *svcname = getenv("SVCNAME");
+ char *svcname = getenv("RC_SVCNAME");
char *service = NULL;
char *runscript_pid;
char *mtime;
@@ -262,7 +262,7 @@ static int do_mark_service(int argc, char **argv)
if (argc > 1)
service = argv[1];
else
- service = getenv("SVCNAME");
+ service = getenv("RC_SVCNAME");
if (! service || *service == '\0')
eerrorx("%s: no service specified", applet);
@@ -311,7 +311,7 @@ static int do_mark_service(int argc, char **argv)
static int do_value(int argc, char **argv)
{
bool ok = false;
- char *service = getenv("SVCNAME");
+ char *service = getenv("RC_SVCNAME");
char *option;
if (! service)
diff --git a/src/rc/runscript.c b/src/rc/runscript.c
index a889e6a..b0d6fca 100644
--- a/src/rc/runscript.c
+++ b/src/rc/runscript.c
@@ -1129,7 +1129,7 @@ int runscript(int argc, char **argv)
}
setenv("EINFO_LOG", service, 1);
- setenv("SVCNAME", applet, 1);
+ setenv("RC_SVCNAME", applet, 1);
/* Set an env var so that we always know our pid regardless of any
subshells the init script may create so that our mark_service_*
diff --git a/src/rc/start-stop-daemon.c b/src/rc/start-stop-daemon.c
index 6aec70b..b989582 100644
--- a/src/rc/start-stop-daemon.c
+++ b/src/rc/start-stop-daemon.c
@@ -583,7 +583,7 @@ int start_stop_daemon(int argc, char **argv)
int stderr_fd;
pid_t pid;
int i;
- char *svcname = getenv("SVCNAME");
+ char *svcname = getenv("RC_SVCNAME");
RC_STRINGLIST *env_list;
RC_STRING *env;
char *path;
@@ -974,8 +974,9 @@ int start_stop_daemon(int argc, char **argv)
rc_stringlist_add(env_list, environ[i++]);
TAILQ_FOREACH(env, env_list, entries) {
if ((strncmp(env->value, "RC_", 3) == 0 &&
- strncmp(env->value, "RC_SERVICE=", strlen("RC_SERVICE=")) != 0) ||
- strncmp(env->value, "SSD_NICELEVEL=", strlen("SSD_NICELEVEL=")) == 0)
+ strncmp(env->value, "RC_SERVICE=", 10) != 0 &&
+ strncmp(env->value, "RC_SVCNAME=", 10) != 0) ||
+ strncmp(env->value, "SSD_NICELEVEL=", 14)) == 0)
{
p = strchr(env->value, '=');
*p = '\0';