shared/utils: systemd-cgls shows 'n/a' when piping output
-1 was used to signal failure, but the type was unsigned. https://bugs.freedesktop.org/show_bug.cgi?id=56644
This commit is contained in:
parent
e3657ecd7f
commit
7009eec208
|
@ -3803,7 +3803,7 @@ int fd_columns(int fd) {
|
|||
|
||||
unsigned columns(void) {
|
||||
const char *e;
|
||||
unsigned c;
|
||||
int c;
|
||||
|
||||
if (_likely_(cached_columns > 0))
|
||||
return cached_columns;
|
||||
|
@ -3811,7 +3811,7 @@ unsigned columns(void) {
|
|||
c = 0;
|
||||
e = getenv("COLUMNS");
|
||||
if (e)
|
||||
safe_atou(e, &c);
|
||||
safe_atoi(e, &c);
|
||||
|
||||
if (c <= 0)
|
||||
c = fd_columns(STDOUT_FILENO);
|
||||
|
|
Loading…
Reference in New Issue