env-util: Add helper to store current log level

This is useful after a fork but before an exec into a binary that uses
systemd's logging utilities. For example, this should be used in dbus
services that fork off worker processes: currently, the log level set by
the LogControl dbus API will be lost because of the exec, and the worker
process will not have the correct log level set.
This commit is contained in:
Adrian Vovk
2024-02-14 09:21:45 +01:00
committed by Lennart Poettering
parent 2fe27f966f
commit 83b4576195
2 changed files with 13 additions and 0 deletions
+1
View File
@@ -72,6 +72,7 @@ int set_unset_env(const char *name, const char *value, bool overwrite);
int putenv_dup(const char *assignment, bool override);
int setenv_systemd_exec_pid(bool update_only);
int setenv_systemd_log_level(void);
/* Parses and does sanity checks on an environment variable containing
* PATH-like colon-separated absolute paths */