diff options
author | Lennart Poettering <lennart@poettering.net> | 2011-11-08 19:44:16 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-11-08 19:44:16 +0100 |
commit | 1e2579fdeb7608719cb28da0b5061f48ba0efc34 (patch) | |
tree | 83352697294bd24015efdce199e8fbc3d2788f6e /src/manager.c | |
parent | a40593a0d0d740efa387e35411e1e456a6c5aba7 (diff) | |
parent | 4cbd9ecf45f64c3a9acc99d473fbf3be3687ae24 (diff) |
Merge branch 'master' into journal
Diffstat (limited to 'src/manager.c')
-rw-r--r-- | src/manager.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/manager.c b/src/manager.c index ac5bbef1a8..f8cbcfcc98 100644 --- a/src/manager.c +++ b/src/manager.c @@ -286,7 +286,10 @@ int manager_new(ManagerRunningAs running_as, Manager **_m) { goto fail; #ifdef HAVE_AUDIT - if ((m->audit_fd = audit_open()) < 0) + if ((m->audit_fd = audit_open()) < 0 && + /* If the kernel lacks netlink or audit support, + * don't worry about it. */ + errno != EAFNOSUPPORT && errno != EPROTONOSUPPORT) log_error("Failed to connect to audit log: %m"); #endif @@ -1214,13 +1217,18 @@ static int transaction_apply(Manager *m, JobMode mode) { /* When isolating first kill all installed jobs which * aren't part of the new transaction */ + rescan: HASHMAP_FOREACH(j, m->jobs, i) { assert(j->installed); if (hashmap_get(m->transaction_jobs, j->unit)) continue; - job_finish_and_invalidate(j, JOB_CANCELED); + /* 'j' itself is safe to remove, but if other jobs + are invalidated recursively, our iterator may become + invalid and we need to start over. */ + if (job_finish_and_invalidate(j, JOB_CANCELED) > 0) + goto rescan; } } |