chiark / gitweb /
Prep v221: Some more cleanup and a few fixes
authorSven Eden <yamakuzure@gmx.net>
Fri, 30 Dec 2016 13:09:01 +0000 (14:09 +0100)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 09:18:01 +0000 (10:18 +0100)
The files
- src/core/org.freedesktop.systemd.policy.in.in and
- src/core/systemd.pc.in
have been deleted as they are not needed.

The other changes are some minor fixes.

src/basic/cgroup-util.c
src/basic/def.h
src/basic/mempool.c
src/basic/rm-rf.c
src/core/org.freedesktop.systemd1.policy.in.in [deleted file]
src/login/loginctl.c

index ba9eeb92165eea79522bffaa60bf681c28fac1eb..4d321e30b3e30d30fa5ecc54f8ebeb74c945d96c 100644 (file)
@@ -748,7 +748,7 @@ int cg_pid_get_path(const char *controller, pid_t pid, char **path) {
 
                 controller = normalize_controller(controller);
         } else
 
                 controller = normalize_controller(controller);
         } else
-                controller = SYSTEMD_CGROUP_CONTROLLER;
+                controller = ELOGIND_CGROUP_CONTROLLER;
 
         fs = procfs_file_alloca(pid, "cgroup");
 
 
         fs = procfs_file_alloca(pid, "cgroup");
 
@@ -1060,7 +1060,7 @@ int cg_mangle_path(const char *path, char **result) {
         if (r < 0)
                 return r;
 
         if (r < 0)
                 return r;
 
-        return cg_get_path(c ? c : SYSTEMD_CGROUP_CONTROLLER, p ? p : "/", NULL, result);
+        return cg_get_path(c ? c : ELOGIND_CGROUP_CONTROLLER, p ? p : "/", NULL, result);
 }
 
 int cg_get_root_path(char **path) {
 }
 
 int cg_get_root_path(char **path) {
@@ -1069,7 +1069,7 @@ int cg_get_root_path(char **path) {
 
         assert(path);
 
 
         assert(path);
 
-        r = cg_pid_get_path(SYSTEMD_CGROUP_CONTROLLER, 1, &p);
+        r = cg_pid_get_path(ELOGIND_CGROUP_CONTROLLER, 1, &p);
         if (r < 0)
                 return r;
 
         if (r < 0)
                 return r;
 
@@ -1117,7 +1117,7 @@ int cg_pid_get_path_shifted(pid_t pid, const char *root, char **cgroup) {
         assert(pid >= 0);
         assert(cgroup);
 
         assert(pid >= 0);
         assert(cgroup);
 
-        r = cg_pid_get_path(SYSTEMD_CGROUP_CONTROLLER, pid, &raw);
+        r = cg_pid_get_path(ELOGIND_CGROUP_CONTROLLER, pid, &raw);
         if (r < 0)
                 return r;
 
         if (r < 0)
                 return r;
 
@@ -1754,7 +1754,7 @@ int cg_create_everywhere(CGroupControllerMask supported, CGroupControllerMask ma
          * in all others */
 
         /* First create the cgroup in our own hierarchy. */
          * in all others */
 
         /* First create the cgroup in our own hierarchy. */
-        r = cg_create(SYSTEMD_CGROUP_CONTROLLER, path);
+        r = cg_create(ELOGIND_CGROUP_CONTROLLER, path);
         if (r < 0)
                 return r;
 
         if (r < 0)
                 return r;
 
@@ -1776,7 +1776,7 @@ int cg_attach_everywhere(CGroupControllerMask supported, const char *path, pid_t
         const char *n;
         int r;
 
         const char *n;
         int r;
 
-        r = cg_attach(SYSTEMD_CGROUP_CONTROLLER, path, pid);
+        r = cg_attach(ELOGIND_CGROUP_CONTROLLER, path, pid);
         if (r < 0)
                 return r;
 
         if (r < 0)
                 return r;
 
@@ -1823,7 +1823,7 @@ int cg_migrate_everywhere(CGroupControllerMask supported, const char *from, cons
         int r;
 
         if (!path_equal(from, to))  {
         int r;
 
         if (!path_equal(from, to))  {
-                r = cg_migrate_recursive(SYSTEMD_CGROUP_CONTROLLER, from, SYSTEMD_CGROUP_CONTROLLER, to, false, true);
+                r = cg_migrate_recursive(ELOGIND_CGROUP_CONTROLLER, from, ELOGIND_CGROUP_CONTROLLER, to, false, true);
                 if (r < 0)
                         return r;
         }
                 if (r < 0)
                         return r;
         }
@@ -1838,7 +1838,7 @@ int cg_migrate_everywhere(CGroupControllerMask supported, const char *from, cons
                         if (!p)
                                 p = to;
 
                         if (!p)
                                 p = to;
 
-                        cg_migrate_recursive_fallback(SYSTEMD_CGROUP_CONTROLLER, to, n, p, false, false);
+                        cg_migrate_recursive_fallback(ELOGIND_CGROUP_CONTROLLER, to, n, p, false, false);
                 }
 
                 bit <<= 1;
                 }
 
                 bit <<= 1;
@@ -1852,7 +1852,7 @@ int cg_trim_everywhere(CGroupControllerMask supported, const char *path, bool de
         const char *n;
         int r;
 
         const char *n;
         int r;
 
-        r = cg_trim(SYSTEMD_CGROUP_CONTROLLER, path, delete_root);
+        r = cg_trim(ELOGIND_CGROUP_CONTROLLER, path, delete_root);
         if (r < 0)
                 return r;
 
         if (r < 0)
                 return r;
 
index 5aaba1fe87264d06b2ca6448eafae0e167a9f07b..a6bd34c9de669d10380a8dac7d9c077b06273329 100644 (file)
@@ -35,7 +35,7 @@
  * the watchdog pings will keep the loop busy. */
 #define DEFAULT_EXIT_USEC (30*USEC_PER_SEC)
 
  * the watchdog pings will keep the loop busy. */
 #define DEFAULT_EXIT_USEC (30*USEC_PER_SEC)
 
-#define SYSTEMD_CGROUP_CONTROLLER "systemd"
+#define ELOGIND_CGROUP_CONTROLLER "elogind"
 
 #define SIGNALS_CRASH_HANDLER SIGSEGV,SIGILL,SIGFPE,SIGBUS,SIGQUIT,SIGABRT
 #define SIGNALS_IGNORE SIGPIPE
 
 #define SIGNALS_CRASH_HANDLER SIGSEGV,SIGILL,SIGFPE,SIGBUS,SIGQUIT,SIGABRT
 #define SIGNALS_IGNORE SIGPIPE
index 19c0edfa6445f59eb7adc3c44814c9a87848394b..fd06481399b443ca21b3ec8d80d435046cb39585 100644 (file)
@@ -88,9 +88,11 @@ void mempool_free_tile(struct mempool *mp, void *p) {
         mp->freelist = p;
 }
 
         mp->freelist = p;
 }
 
+/// UNNEEDED by elogind
+#if 0
 #ifdef VALGRIND
 
 #ifdef VALGRIND
 
-// UNNEEDED void mempool_drop(struct mempool *mp) {
+void mempool_drop(struct mempool *mp) {
         struct pool *p = mp->first_pool;
         while (p) {
                 struct pool *n;
         struct pool *p = mp->first_pool;
         while (p) {
                 struct pool *n;
@@ -101,3 +103,4 @@ void mempool_free_tile(struct mempool *mp, void *p) {
 }
 
 #endif
 }
 
 #endif
+#endif // 0
index d35d172958fb6ea3f3cc154f72e5d3f3cfff9a76..d3c04f11f8abf0f17b221e93f7ad0948387e5e4f 100644 (file)
@@ -122,7 +122,7 @@ int rm_rf_children(int fd, RemoveFlags flags, struct stat *root_dev) {
                                 /* This could be a subvolume, try to remove it */
                                 r = btrfs_subvol_remove_fd(fd, de->d_name, true);
                                 if (r < 0) {
                                 /* This could be a subvolume, try to remove it */
                                 r = btrfs_subvol_remove_fd(fd, de->d_name, true);
                                 if (r < 0) {
-                                       if (r != -ENOTTY && r != -EINVAL) {
+                                        if (r != -ENOTTY && r != -EINVAL) {
                                                 if (ret == 0)
                                                         ret = r;
 
                                                 if (ret == 0)
                                                         ret = r;
 
@@ -138,7 +138,7 @@ int rm_rf_children(int fd, RemoveFlags flags, struct stat *root_dev) {
                                         safe_close(subdir_fd);
                                         continue;
                                 }
                                         safe_close(subdir_fd);
                                         continue;
                                 }
-                       }
+                        }
 #endif // 0
 
                         /* We pass REMOVE_PHYSICAL here, to avoid
 #endif // 0
 
                         /* We pass REMOVE_PHYSICAL here, to avoid
@@ -177,18 +177,18 @@ int rm_rf(const char *path, RemoveFlags flags) {
                 return -EPERM;
         }
 
                 return -EPERM;
         }
 
+#if 0
         if ((flags & (REMOVE_SUBVOLUME|REMOVE_ROOT|REMOVE_PHYSICAL)) == (REMOVE_SUBVOLUME|REMOVE_ROOT|REMOVE_PHYSICAL)) {
                 /* Try to remove as subvolume first */
         if ((flags & (REMOVE_SUBVOLUME|REMOVE_ROOT|REMOVE_PHYSICAL)) == (REMOVE_SUBVOLUME|REMOVE_ROOT|REMOVE_PHYSICAL)) {
                 /* Try to remove as subvolume first */
-#if 0
-               r = btrfs_subvol_remove(path, true);
+                r = btrfs_subvol_remove(path, true);
                 if (r >= 0)
                         return r;
 
                 if (r != -ENOTTY && r != -EINVAL && r != -ENOTDIR)
                         return r;
                 if (r >= 0)
                         return r;
 
                 if (r != -ENOTTY && r != -EINVAL && r != -ENOTDIR)
                         return r;
-#endif // 0
                 /* Not btrfs or not a subvolume */
         }
                 /* Not btrfs or not a subvolume */
         }
+#endif // 0
 
         fd = open(path, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC|O_NOFOLLOW|O_NOATIME);
         if (fd < 0) {
 
         fd = open(path, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC|O_NOFOLLOW|O_NOATIME);
         if (fd < 0) {
diff --git a/src/core/org.freedesktop.systemd1.policy.in.in b/src/core/org.freedesktop.systemd1.policy.in.in
deleted file mode 100644 (file)
index cc39a9e..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?> <!--*-nxml-*-->
-<!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
-        "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
-
-<!--
-  This file is part of systemd.
-
-  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.
--->
-
-<policyconfig>
-
-        <vendor>The systemd Project</vendor>
-        <vendor_url>http://www.freedesktop.org/wiki/Software/systemd</vendor_url>
-
-        <action id="org.freedesktop.systemd1.reply-password">
-                <_description>Send passphrase back to system</_description>
-                <_message>Authentication is required to send the entered passphrase back to the system.</_message>
-                <defaults>
-                        <allow_any>no</allow_any>
-                        <allow_inactive>no</allow_inactive>
-                        <allow_active>auth_admin_keep</allow_active>
-                </defaults>
-                <annotate key="org.freedesktop.policykit.exec.path">@rootlibexecdir@/systemd-reply-password</annotate>
-        </action>
-
-        <action id="org.freedesktop.systemd1.manage-units">
-                <_description>Manage system services or other units</_description>
-                <_message>Authentication is required to manage system services or other units.</_message>
-                <defaults>
-                        <allow_any>auth_admin</allow_any>
-                        <allow_inactive>auth_admin</allow_inactive>
-                        <allow_active>auth_admin_keep</allow_active>
-                </defaults>
-        </action>
-
-        <action id="org.freedesktop.systemd1.manage-unit-files">
-                <_description>Manage system service or unit files</_description>
-                <_message>Authentication is required to manage system service or unit files.</_message>
-                <defaults>
-                        <allow_any>auth_admin</allow_any>
-                        <allow_inactive>auth_admin</allow_inactive>
-                        <allow_active>auth_admin_keep</allow_active>
-                </defaults>
-        </action>
-
-        <action id="org.freedesktop.systemd1.set-environment">
-                <_description>Set or unset system and service manager environment variables</_description>
-                <_message>Authentication is required to set or unset system and service manager environment variables.</_message>
-                <defaults>
-                        <allow_any>auth_admin</allow_any>
-                        <allow_inactive>auth_admin</allow_inactive>
-                        <allow_active>auth_admin_keep</allow_active>
-                </defaults>
-        </action>
-
-        <action id="org.freedesktop.systemd1.reload-daemon">
-                <_description>Reload the systemd state</_description>
-                <_message>Authentication is required to reload the systemd state.</_message>
-                <defaults>
-                        <allow_any>auth_admin</allow_any>
-                        <allow_inactive>auth_admin</allow_inactive>
-                        <allow_active>auth_admin_keep</allow_active>
-                </defaults>
-        </action>
-
-</policyconfig>
index c44209fe04106e7affd54d868af026be000b75ea..bd7ec27da42500435537949aaaddc96b8c47d702 100644 (file)
@@ -266,7 +266,7 @@ static int show_unit_cgroup(sd_bus *bus, const char *interface, const char *unit
         if (isempty(cgroup))
                 return 0;
 
         if (isempty(cgroup))
                 return 0;
 
-        if (cg_is_empty_recursive(SYSTEMD_CGROUP_CONTROLLER, cgroup, false) != 0 && leader <= 0)
+        if (cg_is_empty_recursive(ELOGIND_CGROUP_CONTROLLER, cgroup, false) != 0 && leader <= 0)
                 return 0;
 
         c = columns();
                 return 0;
 
         c = columns();
@@ -275,7 +275,7 @@ static int show_unit_cgroup(sd_bus *bus, const char *interface, const char *unit
         else
                 c = 0;
 
         else
                 c = 0;
 
-        show_cgroup_and_extra(SYSTEMD_CGROUP_CONTROLLER, cgroup, "\t\t  ", c, false, &leader, leader > 0, get_output_flags());
+        show_cgroup_and_extra(ELOGIND_CGROUP_CONTROLLER, cgroup, "\t\t  ", c, false, &leader, leader > 0, get_output_flags());
         return 0;
 }
 
         return 0;
 }