mirror of
https://github.com/AuxXxilium/eudev.git
synced 2024-12-28 06:35:34 +07:00
job: don't access j->type when j is already freed
This commit is contained in:
parent
c77bc38d28
commit
a6a9a78d95
@ -502,11 +502,11 @@ int job_finish_and_invalidate(Job *j, JobResult result) {
|
||||
t = j->type;
|
||||
job_free(j);
|
||||
|
||||
if (result == JOB_FAILED && j->type == JOB_START)
|
||||
if (result == JOB_FAILED && t == JOB_START)
|
||||
unit_status_printf(u, "Starting %s " ANSI_HIGHLIGHT_ON "failed" ANSI_HIGHLIGHT_OFF ", see 'systemctl status %s' for details.\n", unit_description(u), u->meta.id);
|
||||
else if (result == JOB_TIMEOUT && j->type == JOB_START)
|
||||
else if (result == JOB_TIMEOUT && t == JOB_START)
|
||||
unit_status_printf(u, "Starting %s " ANSI_HIGHLIGHT_ON "timed out" ANSI_HIGHLIGHT_OFF ".\n", unit_description(u), u->meta.id);
|
||||
else if (result == JOB_TIMEOUT && j->type == JOB_STOP)
|
||||
else if (result == JOB_TIMEOUT && t == JOB_STOP)
|
||||
unit_status_printf(u, "Stopping %s " ANSI_HIGHLIGHT_ON "timed out" ANSI_HIGHLIGHT_OFF ".\n", unit_description(u), u->meta.id);
|
||||
|
||||
/* Fail depending jobs on failure */
|
||||
|
Loading…
Reference in New Issue
Block a user