]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
SVCNAME -> RC_SVCNAME
authorRoy Marples <roy@marples.name>
Fri, 12 Sep 2014 08:34:47 +0000 (08:34 +0000)
committerRoy Marples <roy@marples.name>
Fri, 12 Sep 2014 08:34:47 +0000 (08:34 +0000)
README
dhcpcd-run-hooks.8.in
script.c

diff --git a/README b/README
index 3ee66833891dae047204dbf9e141d71f1912c03b..b6d75d85d3dc459bd12a0d8e63ba2e0910854555 100644 (file)
--- a/README
+++ b/README
@@ -98,8 +98,8 @@ To add more simply
 ./configure -with-hook=ntp.conf
 
 Some system services expose the name of the service we are in,
-by default dhcpcd will pick SVCNAME from the environment.
-You can override this in CPPFLAGS+= -DSVCNAME="RC_SVCNAME".
+by default dhcpcd will pick RC_SVCNAME from the environment.
+You can override this in CPPFLAGS+= -DRC_SVCNAME="YOUR_SVCNAME".
 This is important because dhcpcd will scrub the environment aside from $PATH
 before running hooks.
 This variable could be used to facilitate service re-entry so this chain could
index d280d5624d19f61a56adfa8e05e78c639dd6801b..217b3543a1c9bb205a5d63df18fc09299f92e1a0 100644 (file)
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd September 9, 2014
+.Dd September 12, 2014
 .Dt DHCPCD-RUN-HOOKS 8
 .Os
 .Sh NAME
@@ -131,7 +131,7 @@ script to process them.
 will clear the environment variables aside from
 .Ev $PATH
 and
-.Ev $SVCNAME .
+.Ev $RC_SVCNAME .
 The following variables will then be set, along with any protocol supplied
 ones.
 .Bl -tag -width Xinterface_order
index 4ff6823d5e0087ff853eba9f8d2171236d6b0933..f0f8d27c01f42b66e4ab73a650ef3eded6590312 100644 (file)
--- a/script.c
+++ b/script.c
@@ -58,8 +58,8 @@
 #endif
 
 /* Allow the OS to define another script env var name */
-#ifndef SVCNAME
-#define SVCNAME "SVCNAME"
+#ifndef RC_SVCNAME
+#define RC_SVCNAME "RC_SVCNAME"
 #endif
 
 #define DEFAULT_PATH   "PATH=/usr/bin:/usr/sbin:/bin:/sbin"
@@ -632,8 +632,8 @@ script_runreason(const struct interface *ifp, const char *reason)
                syslog(LOG_ERR, "%s: make_env: %m", ifp->name);
                return -1;
        }
-       /* Resize for PATH and SVCNAME */
-       svcname = getenv(SVCNAME);
+       /* Resize for PATH and RC_SVCNAME */
+       svcname = getenv(RC_SVCNAME);
        ep = realloc(env, sizeof(char *) * (elen + 2 + (svcname ? 1 : 0)));
        if (ep == NULL) {
                elen = 0;
@@ -658,13 +658,13 @@ script_runreason(const struct interface *ifp, const char *reason)
                }
        }
        if (svcname) {
-               e = strlen(SVCNAME) + strlen(svcname) + 2;
+               e = strlen(RC_SVCNAME) + strlen(svcname) + 2;
                env[++elen] = malloc(e);
                if (env[elen] == NULL) {
                        elen = 0;
                        goto out;
                }
-               snprintf(env[elen], e, "%s=%s", SVCNAME, svcname);
+               snprintf(env[elen], e, "%s=%s", RC_SVCNAME, svcname);
        }
        env[++elen] = NULL;