chiark / gitweb /
core/execute: only clean the environment, if we have one
[elogind.git] / src / core / execute.c
index c363342e805ee4c083a8d83cf14acabdf2cc941c..26cde24f150de8e337bba53e01d4c2c1ed8a2ddb 100644 (file)
@@ -1036,9 +1036,10 @@ int exec_spawn(ExecCommand *command,
                 return log_oom();
 
         log_struct_unit(LOG_DEBUG,
-                   unit_id,
-                   "MESSAGE=About to execute %s", line,
-                   NULL);
+                        unit_id,
+                        "EXECUTABLE=%s", command->path,
+                        "MESSAGE=About to execute: %s", line,
+                        NULL);
         free(line);
 
         r = cgroup_bonding_realize_list(cgroup_bondings);
@@ -1523,8 +1524,8 @@ int exec_spawn(ExecCommand *command,
                                 log_struct_unit(LOG_DEBUG,
                                                 unit_id,
                                                 "EXECUTABLE=%s", command->path,
-                                                "MESSAGE=Executing: %s",
-                                                line, NULL);
+                                                "MESSAGE=Executing: %s", line,
+                                                NULL);
                                 log_close();
                                 free(line);
                                 line = NULL;
@@ -1771,7 +1772,8 @@ int exec_context_load_environment(const ExecContext *c, char ***l) {
                                 return k;
                          }
                         /* Log invalid environment variables with filename */
-                        p = strv_env_clean_log(p, pglob.gl_pathv[n]);
+                       if (p)
+                               p = strv_env_clean_log(p, pglob.gl_pathv[n]);
 
                         if (r == NULL)
                                 r = p;