summaryrefslogtreecommitdiff
path: root/src/home
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-05-20 19:55:39 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-05-21 08:10:13 +0200
commita60416f319439fc34b90225855ee88247c920854 (patch)
treed1ecb04db17d686c4069c4f19cd261918a51413b /src/home
parentb10ceb47836201faa0d374cd9f536d2f503457a7 (diff)
downloadsystemd-a60416f319439fc34b90225855ee88247c920854.tar.gz
homed: fix return value mix-up
We generally return > 1 if any of the actions we are doing is instantly complete and == 0 when we started doing it asynchronously (by forking off homework), in our functions that execute operations on homes. Fix a mix-up where the test for this was reversed in home_dispatch_release() and home_dispatch_lock_all(). Fixes: #15684
Diffstat (limited to 'src/home')
-rw-r--r--src/home/homed-home.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/home/homed-home.c b/src/home/homed-home.c
index 65e363c23c..be1a710ccc 100644
--- a/src/home/homed-home.c
+++ b/src/home/homed-home.c
@@ -2364,7 +2364,7 @@ static int home_dispatch_release(Home *h, Operation *o) {
case HOME_UNFIXATED:
case HOME_ABSENT:
case HOME_INACTIVE:
- r = 0; /* done */
+ r = 1; /* done */
break;
case HOME_LOCKED:
@@ -2384,7 +2384,7 @@ static int home_dispatch_release(Home *h, Operation *o) {
assert(!h->current_operation);
- if (r <= 0) /* failure or completed */
+ if (r != 0) /* failure or completed */
operation_result(o, r, &error);
else /* ongoing */
h->current_operation = operation_ref(o);
@@ -2406,12 +2406,12 @@ static int home_dispatch_lock_all(Home *h, Operation *o) {
case HOME_ABSENT:
case HOME_INACTIVE:
log_info("Home %s is not active, no locking necessary.", h->user_name);
- r = 0; /* done */
+ r = 1; /* done */
break;
case HOME_LOCKED:
log_info("Home %s is already locked.", h->user_name);
- r = 0; /* done */
+ r = 1; /* done */
break;
case HOME_ACTIVE: