From 70b0d72c6477dca2bf10f969916ba16832536784 Mon Sep 17 00:00:00 2001 From: Sander Mertens Date: Tue, 10 Jul 2018 22:32:55 -0700 Subject: [PATCH] #341 set HOSTNAME as environment variable for convenience --- src/store/bootstrap.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/store/bootstrap.c b/src/store/bootstrap.c index cd5994ca..ff182e12 100644 --- a/src/store/bootstrap.c +++ b/src/store/bootstrap.c @@ -996,6 +996,12 @@ void corto_environment_init(void) corto_setenv("BAKE_TARGET", "."); } + if (!corto_getenv("HOSTNAME")) { + corto_id hostname; + gethostname(hostname, sizeof(hostname)); + corto_setenv("HOSTNAME", hostname); + } + corto_string enableBacktrace = corto_getenv("CORTO_LOG_BACKTRACE"); if (enableBacktrace) { CORTO_LOG_BACKTRACE = !strcmp(enableBacktrace, "true");