]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/shared/cgroup-show.c
tree-wide: drop 'This file is part of systemd' blurb
[thirdparty/systemd.git] / src / shared / cgroup-show.c
index 0ddae954343f7fc2895d1bc8c6abc54b26570551..24ce622daea9e1861aee9b5fc8cd38f348ab16b4 100644 (file)
@@ -1,21 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 /***
-  This file is part of systemd.
-
   Copyright 2010 Lennart Poettering
-
-  systemd is free software; you can redistribute it and/or modify it
-  under the terms of the GNU Lesser General Public License as published by
-  the Free Software Foundation; either version 2.1 of the License, or
-  (at your option) any later version.
-
-  systemd is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public License
-  along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
 #include <dirent.h>
@@ -189,8 +174,7 @@ int show_cgroup_by_path(
                         free(last);
                 }
 
-                last = k;
-                k = NULL;
+                last = TAKE_PTR(k);
         }
 
         if (r < 0)
@@ -358,7 +342,7 @@ int show_cgroup_get_path_and_warn(
                 const char *m;
 
                 m = strjoina("/run/systemd/machines/", machine);
-                r = parse_env_file(m, NEWLINE, "SCOPE", &unit, NULL);
+                r = parse_env_file(NULL, m, NEWLINE, "SCOPE", &unit, NULL);
                 if (r < 0)
                         return log_error_errno(r, "Failed to load machine data: %m");
 
@@ -386,10 +370,8 @@ int show_cgroup_get_path_and_warn(
                         return log_oom();
 
                 *ret = t;
-        } else {
-                *ret = root;
-                root = NULL;
-        }
+        } else
+                *ret = TAKE_PTR(root);
 
         return 0;
 }