mirror of
https://github.com/systemd/systemd.git
synced 2024-11-02 10:51:20 +03:00
swap: avoid bad memory access
This commit is contained in:
parent
f8c0a2cb69
commit
b6bfc7bbee
@ -535,25 +535,30 @@ static void swap_dump(Unit *u, FILE *f, const char *prefix) {
|
||||
p = &s->parameters_proc_swaps;
|
||||
else if (s->from_fragment)
|
||||
p = &s->parameters_fragment;
|
||||
else
|
||||
p = NULL;
|
||||
|
||||
fprintf(f,
|
||||
"%sSwap State: %s\n"
|
||||
"%sResult: %s\n"
|
||||
"%sWhat: %s\n"
|
||||
"%sPriority: %i\n"
|
||||
"%sNoAuto: %s\n"
|
||||
"%sNoFail: %s\n"
|
||||
"%sFrom /proc/swaps: %s\n"
|
||||
"%sFrom fragment: %s\n",
|
||||
prefix, swap_state_to_string(s->state),
|
||||
prefix, swap_result_to_string(s->result),
|
||||
prefix, s->what,
|
||||
prefix, p->priority,
|
||||
prefix, yes_no(p->noauto),
|
||||
prefix, yes_no(p->nofail),
|
||||
prefix, yes_no(s->from_proc_swaps),
|
||||
prefix, yes_no(s->from_fragment));
|
||||
|
||||
if (p)
|
||||
fprintf(f,
|
||||
"%sPriority: %i\n"
|
||||
"%sNoAuto: %s\n"
|
||||
"%sNoFail: %s\n",
|
||||
prefix, p->priority,
|
||||
prefix, yes_no(p->noauto),
|
||||
prefix, yes_no(p->nofail));
|
||||
|
||||
if (s->control_pid > 0)
|
||||
fprintf(f,
|
||||
"%sControl PID: %lu\n",
|
||||
|
Loading…
Reference in New Issue
Block a user