summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-12-03 13:57:42 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-12-17 13:57:04 -0500
commitc73838280cb107a10e0d8d45227d5471db56368f (patch)
treef8e57c6d966b36f9ae8bc5301d36f3c27869ae3c /src/shared
parent117d5a27a3480fd9729cfadd98d135d21732a88d (diff)
Modify mount_propagation_flags_from_string to return a normal int code
This means that callers can distiguish an error from flags==0, and don't have to special-case the empty string.
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/bus-unit-util.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c
index b030b3b9d1..829be2c6da 100644
--- a/src/shared/bus-unit-util.c
+++ b/src/shared/bus-unit-util.c
@@ -579,15 +579,9 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen
else if (streq(field, "MountFlags")) {
unsigned long f;
- if (isempty(eq))
- f = 0;
- else {
- f = mount_propagation_flags_from_string(eq);
- if (f == 0) {
- log_error("Failed to parse mount propagation type: %s", eq);
- return -EINVAL;
- }
- }
+ r = mount_propagation_flags_from_string(eq, &f);
+ if (r < 0)
+ return log_error_errno(r, "Failed to parse mount propagation flags: %s", eq);
r = sd_bus_message_append(m, "v", "t", f);
} else if (STR_IN_SET(field, "BindPaths", "BindReadOnlyPaths")) {