X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fmanager.c;h=a01710f445f92f5f990d6602ee3bc7374228ffeb;hb=c17ec25e4d9bd6c8e8617416f813e25b2ebbafc5;hp=a3eeb4afc10c9837c238bc4e1c9d739e6b9cda25;hpb=5052495bbaf318d132024e75295da2f5d721420c;p=elogind.git diff --git a/src/core/manager.c b/src/core/manager.c index a3eeb4afc..a01710f44 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -226,10 +226,8 @@ static void draw_cylon(char buffer[], size_t buflen, unsigned width, unsigned po assert(pos <= width+1); /* 0 or width+1 mean that the center light is behind the corner */ if (pos > 1) { - if (pos > 2) { - memset(p, ' ', pos-2); - p += pos-2; - } + if (pos > 2) + p = mempset(p, ' ', pos-2); p = stpcpy(p, ANSI_RED_ON); *p++ = '*'; } @@ -244,10 +242,8 @@ static void draw_cylon(char buffer[], size_t buflen, unsigned width, unsigned po if (pos < width) { p = stpcpy(p, ANSI_RED_ON); *p++ = '*'; - if (pos < width-1) { - memset(p, ' ', width-1-pos); - p += width-1-pos; - } + if (pos < width-1) + p = mempset(p, ' ', width-1-pos); p = stpcpy(p, ANSI_HIGHLIGHT_OFF); } } @@ -2337,6 +2333,12 @@ static bool manager_is_booting_or_shutting_down(Manager *m) { return false; } +bool manager_is_reloading_or_reexecuting(Manager *m) { + assert(m); + + return m->n_reloading != 0; +} + void manager_reset_failed(Manager *m) { Unit *u; Iterator i;