chiark / gitweb /
downgrade a few log msgs
[elogind.git] / execute.c
index 0b4baee6478a0fce02893fe12f099f7b541429dc..a36e52b34554595a962adff9214ce7df63499243 100644 (file)
--- a/execute.c
+++ b/execute.c
@@ -35,6 +35,7 @@
 #include <grp.h>
 #include <pwd.h>
 #include <sys/mount.h>
+#include <linux/fs.h>
 
 #include "execute.h"
 #include "strv.h"
@@ -391,8 +392,8 @@ static int chown_terminal(int fd, uid_t uid) {
         assert(fd >= 0);
 
         /* This might fail. What matters are the results. */
-        fchown(fd, uid, -1);
-        fchmod(fd, TTY_MODE);
+        (void) fchown(fd, uid, -1);
+        (void) fchmod(fd, TTY_MODE);
 
         if (fstat(fd, &st) < 0)
                 return -errno;
@@ -723,6 +724,7 @@ int exec_spawn(ExecCommand *command,
                char **argv,
                const ExecContext *context,
                int fds[], unsigned n_fds,
+               char **environment,
                bool apply_permissions,
                bool apply_chroot,
                bool confirm_spawn,
@@ -1033,7 +1035,9 @@ int exec_spawn(ExecCommand *command,
                                 goto fail;
                         }
 
-                if (!(final_env = strv_env_merge(environ, our_env, context->environment, NULL))) {
+                assert(n_env <= 6);
+
+                if (!(final_env = strv_env_merge(environment, our_env, context->environment, NULL))) {
                         r = EXIT_MEMORY;
                         goto fail;
                 }
@@ -1060,10 +1064,7 @@ int exec_spawn(ExecCommand *command,
          * sure that when we kill the cgroup the process will be
          * killed too). */
         if (cgroup_bondings)
-                if ((r = cgroup_bonding_install_list(cgroup_bondings, pid)) < 0) {
-                        r = EXIT_CGROUP;
-                        goto fail;
-                }
+                cgroup_bonding_install_list(cgroup_bondings, pid);
 
         log_debug("Forked %s as %llu", command->path, (unsigned long long) pid);