search for: dump_environ

Displaying 1 result from an estimated 1 matches for "dump_environ".

2023 May 07
2
[PATCH nbdkit] server: Add -D nbdkit.environ=1 to dump the environment
...644 --- a/server/main.c +++ b/server/main.c @@ -210,6 +210,26 @@ dump_config (void) #endif } +#ifndef WIN32 + +/* -D nbdkit.environ=1 to dump the environment at start up. */ +NBDKIT_DLL_PUBLIC int nbdkit_debug_environ; + +#ifndef HAVE_ENVIRON_DECL +extern char **environ; +#endif + +static void +dump_environment (void) +{ + size_t i; + + for (i = 0; environ[i]; ++i) + nbdkit_debug ("%s", environ[i]); +} + +#endif /* !WIN32 */ + int main (int argc, char *argv[]) { @@ -662,6 +682,14 @@ main (int argc, char *argv[]) /* Check all debug flags were used, and free them. */ free_debug_f...