chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
984a2be
)
core/unit: use a temp variable for manager pointer in unit_notify()
author
Michal Schmidt
<mschmidt@redhat.com>
Wed, 27 Feb 2013 22:58:10 +0000
(23:58 +0100)
committer
Michal Schmidt
<mschmidt@redhat.com>
Thu, 28 Feb 2013 01:23:47 +0000
(
02:23
+0100)
src/core/unit.c
patch
|
blob
|
history
diff --git
a/src/core/unit.c
b/src/core/unit.c
index 6fee0506d84832def16a345d2fd9bca317733d27..f8a913e39a5dbb466bba6fc06ac0ecfffc85cee1 100644
(file)
--- a/
src/core/unit.c
+++ b/
src/core/unit.c
@@
-1320,6
+1320,7
@@
void unit_trigger_on_failure(Unit *u) {
}
void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_success) {
}
void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_success) {
+ Manager *m;
bool unexpected;
assert(u);
bool unexpected;
assert(u);
@@
-1332,7
+1333,9
@@
void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_su
* behavior here. For example: if a mount point is remounted
* this function will be called too! */
* behavior here. For example: if a mount point is remounted
* this function will be called too! */
- if (u->manager->n_reloading <= 0) {
+ m = u->manager;
+
+ if (m->n_reloading <= 0) {
dual_timestamp ts;
dual_timestamp_get(&ts);
dual_timestamp ts;
dual_timestamp_get(&ts);
@@
-1420,7
+1423,7
@@
void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_su
} else
unexpected = true;
} else
unexpected = true;
- if (
u->manager
->n_reloading <= 0) {
+ if (
m
->n_reloading <= 0) {
/* If this state change happened without being
* requested by a job, then let's retroactively start
/* If this state change happened without being
* requested by a job, then let's retroactively start
@@
-1456,18
+1459,18
@@
void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_su
/* The bus just might have become available,
* hence try to connect to it, if we aren't
* yet connected. */
/* The bus just might have become available,
* hence try to connect to it, if we aren't
* yet connected. */
- bus_init(
u->manager
, true);
+ bus_init(
m
, true);
if (u->type == UNIT_SERVICE &&
!UNIT_IS_ACTIVE_OR_RELOADING(os) &&
if (u->type == UNIT_SERVICE &&
!UNIT_IS_ACTIVE_OR_RELOADING(os) &&
-
u->manager
->n_reloading <= 0) {
+
m
->n_reloading <= 0) {
/* Write audit record if we have just finished starting up */
/* Write audit record if we have just finished starting up */
- manager_send_unit_audit(
u->manager
, u, AUDIT_SERVICE_START, true);
+ manager_send_unit_audit(
m
, u, AUDIT_SERVICE_START, true);
u->in_audit = true;
}
if (!UNIT_IS_ACTIVE_OR_RELOADING(os))
u->in_audit = true;
}
if (!UNIT_IS_ACTIVE_OR_RELOADING(os))
- manager_send_unit_plymouth(
u->manager
, u);
+ manager_send_unit_plymouth(
m
, u);
} else {
} else {
@@
-1477,25
+1480,25
@@
void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_su
if (u->type == UNIT_SERVICE &&
UNIT_IS_INACTIVE_OR_FAILED(ns) &&
!UNIT_IS_INACTIVE_OR_FAILED(os) &&
if (u->type == UNIT_SERVICE &&
UNIT_IS_INACTIVE_OR_FAILED(ns) &&
!UNIT_IS_INACTIVE_OR_FAILED(os) &&
-
u->manager
->n_reloading <= 0) {
+
m
->n_reloading <= 0) {
/* Hmm, if there was no start record written
* write it now, so that we always have a nice
* pair */
if (!u->in_audit) {
/* Hmm, if there was no start record written
* write it now, so that we always have a nice
* pair */
if (!u->in_audit) {
- manager_send_unit_audit(
u->manager
, u, AUDIT_SERVICE_START, ns == UNIT_INACTIVE);
+ manager_send_unit_audit(
m
, u, AUDIT_SERVICE_START, ns == UNIT_INACTIVE);
if (ns == UNIT_INACTIVE)
if (ns == UNIT_INACTIVE)
- manager_send_unit_audit(
u->manager
, u, AUDIT_SERVICE_STOP, true);
+ manager_send_unit_audit(
m
, u, AUDIT_SERVICE_STOP, true);
} else
/* Write audit record if we have just finished shutting down */
} else
/* Write audit record if we have just finished shutting down */
- manager_send_unit_audit(
u->manager
, u, AUDIT_SERVICE_STOP, ns == UNIT_INACTIVE);
+ manager_send_unit_audit(
m
, u, AUDIT_SERVICE_STOP, ns == UNIT_INACTIVE);
u->in_audit = false;
}
}
u->in_audit = false;
}
}
- manager_recheck_journal(
u->manager
);
+ manager_recheck_journal(
m
);
/* Maybe we finished startup and are now ready for being
* stopped because unneeded? */
/* Maybe we finished startup and are now ready for being
* stopped because unneeded? */