diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-01-05 03:24:39 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-01-05 14:55:35 +0100 |
commit | 81beb7508e72b29ae7cec60b50231cbe0c1d582e (patch) | |
tree | e07af6f9107ecc1e777e37fd549b1a5ff4b82479 /src/unit.c | |
parent | 39ad55a9aa99451f982628af6e14581092b2d2f6 (diff) |
util: when printing status updates during boot, take terminal width into account
Diffstat (limited to 'src/unit.c')
-rw-r--r-- | src/unit.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/src/unit.c b/src/unit.c index 03c90f5874..dea8f4a7fa 100644 --- a/src/unit.c +++ b/src/unit.c @@ -2441,9 +2441,6 @@ int unit_coldplug(Unit *u) { void unit_status_printf(Unit *u, const char *status, const char *format, ...) { va_list ap; - char *s, *e; - int err; - const unsigned emax = status ? 80 - (sizeof("[ OK ]")-1) : 80; assert(u); assert(format); @@ -2458,21 +2455,8 @@ void unit_status_printf(Unit *u, const char *status, const char *format, ...) { return; va_start(ap, format); - err = vasprintf(&s, format, ap); + status_vprintf(status, format, ap); va_end(ap); - if (err < 0) - return; - - e = ellipsize(s, emax, 100); - free(s); - if (!e) - return; - - if (status) - status_printf("%s%*s[%s]\n", e, emax - strlen(e), "", status); - else - status_printf("%s\n", e); - free(e); } bool unit_need_daemon_reload(Unit *u) { |