summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-11-28 02:30:43 +0100
committerLennart Poettering <lennart@poettering.net>2014-11-28 03:16:56 +0100
commit1214b53c8e463ec328021e90163279ac94dd9af8 (patch)
treeb0ba158eba978d2bd7ce5ccc49f05ce063701856 /src
parentbf371116f69261c17e47dc3dbb51cfaa3c9369ff (diff)
kdbus: when running in a container, don't complain that we cannot write to /sys
Diffstat (limited to 'src')
-rw-r--r--src/libsystemd/sd-bus/bus-kernel.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/libsystemd/sd-bus/bus-kernel.c b/src/libsystemd/sd-bus/bus-kernel.c
index a7d18e337b..84fb4bdf2b 100644
--- a/src/libsystemd/sd-bus/bus-kernel.c
+++ b/src/libsystemd/sd-bus/bus-kernel.c
@@ -1810,10 +1810,8 @@ int bus_kernel_fix_attach_mask(void) {
* line option, however. */
r = get_proc_cmdline_key("systemd.kdbus_attach_flags_mask=", &mask);
- if (r < 0) {
- log_warning_errno(-r, "Failed to read kernel command line: %m");
- return r;
- }
+ if (r < 0)
+ return log_warning_errno(r, "Failed to read kernel command line: %m");
if (mask) {
const char *p = mask;
@@ -1827,10 +1825,10 @@ int bus_kernel_fix_attach_mask(void) {
sprintf(buf, "0x%" PRIx64 "\n", m);
r = write_string_file("/sys/module/kdbus/parameters/attach_flags_mask", buf);
- if (r < 0) {
- log_warning_errno(-r, "Failed to write kdbus attach mask: %m");
- return r;
- }
+ if (r < 0)
+ return log_full_errno(
+ r == -EROFS ? LOG_DEBUG : LOG_WARNING, r,
+ "Failed to write kdbus attach mask: %m");
return 0;
}