diff options
Diffstat (limited to 'src/shared/util.c')
-rw-r--r-- | src/shared/util.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/src/shared/util.c b/src/shared/util.c index 1442301cd7..a20e7bb2ef 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -2301,8 +2301,8 @@ static int do_execute(char **directories, usec_t timeout, char *argv[]) { /* We fork this all off from a child process so that we can * somewhat cleanly make use of SIGALRM to set a time limit */ - reset_all_signal_handlers(); - reset_signal_mask(); + (void) reset_all_signal_handlers(); + (void) reset_signal_mask(); assert_se(prctl(PR_SET_PDEATHSIG, SIGTERM) == 0); @@ -3344,8 +3344,8 @@ int fork_agent(pid_t *pid, const int except[], unsigned n_except, const char *pa /* Make sure we actually can kill the agent, if we need to, in * case somebody invoked us from a shell script that trapped * SIGTERM or so... */ - reset_all_signal_handlers(); - reset_signal_mask(); + (void) reset_all_signal_handlers(); + (void) reset_signal_mask(); /* Check whether our parent died before we were able * to set the death signal and unblock the signals */ @@ -4931,15 +4931,11 @@ int bind_remount_recursive(const char *prefix, bool ro) { while ((x = set_steal_first(todo))) { - r = set_put(done, x); - if (r == -EEXIST) { - free(x); + r = set_consume(done, x); + if (r == -EEXIST || r == 0) continue; - } - if (r < 0) { - free(x); + if (r < 0) return r; - } /* Try to reuse the original flag set, but * don't care for errors, in case of @@ -4949,15 +4945,14 @@ int bind_remount_recursive(const char *prefix, bool ro) { orig_flags &= ~MS_RDONLY; if (mount(NULL, x, NULL, orig_flags|MS_BIND|MS_REMOUNT|(ro ? MS_RDONLY : 0), NULL) < 0) { + /* Deal with mount points that are * obstructed by a later mount */ - if (errno != ENOENT) { - free(x); + if (errno != ENOENT) return -errno; - } } - free(x); + } } } |