chiark / gitweb /
environment: append unit_id to error messages regarding EnvironmentFile
[elogind.git] / src / shared / env-util.c
index 20b208f63c6a8bb0b0bf0647e0b2f5a76efd8d1f..d90b878d1920e56b7a455443be3cc3448d4d17c5 100644 (file)
@@ -28,6 +28,7 @@
 #include "util.h"
 #include "env-util.h"
 #include "def.h"
 #include "util.h"
 #include "env-util.h"
 #include "def.h"
+#include "unit.h"
 
 #define VALID_CHARS_ENV_NAME                    \
         DIGITS LETTERS                          \
 
 #define VALID_CHARS_ENV_NAME                    \
         DIGITS LETTERS                          \
@@ -414,7 +415,7 @@ char *strv_env_get(char **l, const char *name) {
         return strv_env_get_n(l, name, strlen(name));
 }
 
         return strv_env_get_n(l, name, strlen(name));
 }
 
-char **strv_env_clean_log(char **e, const char *message) {
+char **strv_env_clean_log(char **e, const char *unit_id, const char *message) {
         char **p, **q;
         int k = 0;
 
         char **p, **q;
         int k = 0;
 
@@ -424,7 +425,7 @@ char **strv_env_clean_log(char **e, const char *message) {
 
                 if (!env_assignment_is_valid(*p)) {
                         if (message)
 
                 if (!env_assignment_is_valid(*p)) {
                         if (message)
-                                log_error("Ignoring invalid environment '%s': %s", *p, message);
+                                log_error_unit(unit_id, "Ignoring invalid environment '%s': %s", *p, message);
                         free(*p);
                         continue;
                 }
                         free(*p);
                         continue;
                 }
@@ -451,5 +452,5 @@ char **strv_env_clean_log(char **e, const char *message) {
 }
 
 char **strv_env_clean(char **e) {
 }
 
 char **strv_env_clean(char **e) {
-        return strv_env_clean_log(e, NULL);
+        return strv_env_clean_log(e, NULL, NULL);
 }
 }