]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/shared/exec-util.c
tree-wide: use ASSERT_PTR more
[thirdparty/systemd.git] / src / shared / exec-util.c
index c1da81e80930dcbbf91a5d12b0d0a68bc673d9f4..19ddf0498625d72bd973a68ee4af3475b86c8bfe 100644 (file)
@@ -91,7 +91,6 @@ static int do_execute(
 
         _cleanup_hashmap_free_free_ Hashmap *pids = NULL;
         _cleanup_strv_free_ char **paths = NULL;
-        char **path, **e;
         int r;
         bool parallel_execution;
 
@@ -254,7 +253,7 @@ int execute_directories(
 }
 
 static int gather_environment_generate(int fd, void *arg) {
-        char ***env = arg, **x, **y;
+        char ***env = ASSERT_PTR(arg);
         _cleanup_fclose_ FILE *f = NULL;
         _cleanup_strv_free_ char **new = NULL;
         int r;
@@ -265,8 +264,6 @@ static int gather_environment_generate(int fd, void *arg) {
          * fd is always consumed, even on error.
          */
 
-        assert(env);
-
         f = fdopen(fd, "r");
         if (!f) {
                 safe_close(fd);
@@ -296,13 +293,11 @@ static int gather_environment_generate(int fd, void *arg) {
 
 static int gather_environment_collect(int fd, void *arg) {
         _cleanup_fclose_ FILE *f = NULL;
-        char ***env = arg;
+        char ***env = ASSERT_PTR(arg);
         int r;
 
         /* Write out a series of env=cescape(VAR=value) assignments to fd. */
 
-        assert(env);
-
         f = fdopen(fd, "w");
         if (!f) {
                 safe_close(fd);
@@ -322,13 +317,11 @@ static int gather_environment_collect(int fd, void *arg) {
 
 static int gather_environment_consume(int fd, void *arg) {
         _cleanup_fclose_ FILE *f = NULL;
-        char ***env = arg;
+        char ***env = ASSERT_PTR(arg);
         int r = 0;
 
         /* Read a series of env=cescape(VAR=value) assignments from fd into env. */
 
-        assert(env);
-
         f = fdopen(fd, "r");
         if (!f) {
                 safe_close(fd);
@@ -369,7 +362,6 @@ static int gather_environment_consume(int fd, void *arg) {
 
 int exec_command_flags_from_strv(char **ex_opts, ExecCommandFlags *flags) {
         ExecCommandFlags ex_flag, ret_flags = 0;
-        char **opt;
 
         assert(flags);