aboutsummaryrefslogtreecommitdiff
path: root/environ.c
diff options
context:
space:
mode:
Diffstat (limited to 'environ.c')
-rw-r--r--environ.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/environ.c b/environ.c
index 31e57e0e..5d06afbf 100644
--- a/environ.c
+++ b/environ.c
@@ -203,3 +203,17 @@ environ_push(struct environ *env)
setenv(envent->name, envent->value, 1);
}
}
+
+/* Log the environment. */
+void
+environ_log(struct environ *env, const char *prefix)
+{
+ struct environ_entry *envent;
+
+ RB_FOREACH(envent, environ, env) {
+ if (envent->value != NULL && *envent->name != '\0') {
+ log_debug("%s%s=%s", prefix, envent->name,
+ envent->value);
+ }
+ }
+}