summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2016-12-30 14:09:01 +0100
committerSven Eden <yamakuzure@gmx.net>2017-03-14 10:18:01 +0100
commitf88c58a33748ad36866544b45e4fe06c506d4c31 (patch)
tree82c1d44b92781affcbc607e20f5b9d06037b301b
parent1cfc78c91965df340cdde100ad6cb3ed50b28927 (diff)
Prep v221: Some more cleanup and a few fixes
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.
-rw-r--r--src/basic/cgroup-util.c18
-rw-r--r--src/basic/def.h2
-rw-r--r--src/basic/mempool.c5
-rw-r--r--src/basic/rm-rf.c10
-rw-r--r--src/core/org.freedesktop.systemd1.policy.in.in70
-rw-r--r--src/login/loginctl.c4
6 files changed, 21 insertions, 88 deletions
diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c
index ba9eeb921..4d321e30b 100644
--- a/src/basic/cgroup-util.c
+++ b/src/basic/cgroup-util.c
@@ -748,7 +748,7 @@ int cg_pid_get_path(const char *controller, pid_t pid, char **path) {
controller = normalize_controller(controller);
} else
- controller = SYSTEMD_CGROUP_CONTROLLER;
+ controller = ELOGIND_CGROUP_CONTROLLER;
fs = procfs_file_alloca(pid, "cgroup");
@@ -1060,7 +1060,7 @@ int cg_mangle_path(const char *path, char **result) {
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) {
@@ -1069,7 +1069,7 @@ int cg_get_root_path(char **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;
@@ -1117,7 +1117,7 @@ int cg_pid_get_path_shifted(pid_t pid, const char *root, char **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;
@@ -1754,7 +1754,7 @@ int cg_create_everywhere(CGroupControllerMask supported, CGroupControllerMask ma
* 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;
@@ -1776,7 +1776,7 @@ int cg_attach_everywhere(CGroupControllerMask supported, const char *path, pid_t
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;
@@ -1823,7 +1823,7 @@ int cg_migrate_everywhere(CGroupControllerMask supported, const char *from, cons
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;
}
@@ -1838,7 +1838,7 @@ int cg_migrate_everywhere(CGroupControllerMask supported, const char *from, cons
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;
@@ -1852,7 +1852,7 @@ int cg_trim_everywhere(CGroupControllerMask supported, const char *path, bool de
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;
diff --git a/src/basic/def.h b/src/basic/def.h
index 5aaba1fe8..a6bd34c9d 100644
--- a/src/basic/def.h
+++ b/src/basic/def.h
@@ -35,7 +35,7 @@
* 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
diff --git a/src/basic/mempool.c b/src/basic/mempool.c
index 19c0edfa6..fd0648139 100644
--- a/src/basic/mempool.c
+++ b/src/basic/mempool.c
@@ -88,9 +88,11 @@ void mempool_free_tile(struct mempool *mp, void *p) {
mp->freelist = p;
}
+/// UNNEEDED by elogind
+#if 0
#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;
@@ -101,3 +103,4 @@ void mempool_free_tile(struct mempool *mp, void *p) {
}
#endif
+#endif // 0
diff --git a/src/basic/rm-rf.c b/src/basic/rm-rf.c
index d35d17295..d3c04f11f 100644
--- a/src/basic/rm-rf.c
+++ b/src/basic/rm-rf.c
@@ -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) {
- if (r != -ENOTTY && r != -EINVAL) {
+ if (r != -ENOTTY && r != -EINVAL) {
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;
}
- }
+ }
#endif // 0
/* We pass REMOVE_PHYSICAL here, to avoid
@@ -177,18 +177,18 @@ int rm_rf(const char *path, RemoveFlags flags) {
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 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;
-#endif // 0
/* 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) {
diff --git a/src/core/org.freedesktop.systemd1.policy.in.in b/src/core/org.freedesktop.systemd1.policy.in.in
deleted file mode 100644
index cc39a9e1c..000000000
--- a/src/core/org.freedesktop.systemd1.policy.in.in
+++ /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>
diff --git a/src/login/loginctl.c b/src/login/loginctl.c
index c44209fe0..bd7ec27da 100644
--- a/src/login/loginctl.c
+++ b/src/login/loginctl.c
@@ -266,7 +266,7 @@ static int show_unit_cgroup(sd_bus *bus, const char *interface, const char *unit
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();
@@ -275,7 +275,7 @@ static int show_unit_cgroup(sd_bus *bus, const char *interface, const char *unit
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;
}