Merge pull request #24708 from keszybz/not-available-in-tables

various: use "-" instead of "n/a" in tables
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2022-09-17 18:16:42 +02:00
committed by GitHub
4 changed files with 15 additions and 15 deletions
+1 -1
View File
@@ -717,7 +717,7 @@ static int print_info(FILE *file, sd_journal *j, bool need_space) {
ansi_normal());
if (size != UINT64_MAX)
fprintf(file, " Disk Size: %s\n", FORMAT_BYTES(size));
fprintf(file, " Size on Disk: %s\n", FORMAT_BYTES(size));
} else if (coredump)
fprintf(file, " Storage: journal\n");
+9 -9
View File
@@ -1464,7 +1464,7 @@ static const char *table_data_format(Table *t, TableData *d, bool avoid_uppercas
else
ret = format_timestamp_relative(p, FORMAT_TIMESTAMP_RELATIVE_MAX, d->timestamp);
if (!ret)
return "n/a";
return "-";
d->formatted = TAKE_PTR(p);
break;
@@ -1480,7 +1480,7 @@ static const char *table_data_format(Table *t, TableData *d, bool avoid_uppercas
if (!format_timespan(p, FORMAT_TIMESPAN_MAX, d->timespan,
d->type == TABLE_TIMESPAN ? 0 : USEC_PER_MSEC))
return "n/a";
return "-";
d->formatted = TAKE_PTR(p);
break;
@@ -1494,7 +1494,7 @@ static const char *table_data_format(Table *t, TableData *d, bool avoid_uppercas
return NULL;
if (!format_bytes(p, FORMAT_BYTES_MAX, d->size))
return "n/a";
return "-";
d->formatted = TAKE_PTR(p);
break;
@@ -1509,7 +1509,7 @@ static const char *table_data_format(Table *t, TableData *d, bool avoid_uppercas
return NULL;
if (!format_bytes_full(p, FORMAT_BYTES_MAX, d->size, 0))
return "n/a";
return "-";
n = strlen(p);
strscpy(p + n, FORMAT_BYTES_MAX + 2 - n, "bps");
@@ -1710,7 +1710,7 @@ static const char *table_data_format(Table *t, TableData *d, bool avoid_uppercas
char *p;
if (!uid_is_valid(d->uid))
return "n/a";
return "-";
p = new(char, DECIMAL_STR_WIDTH(d->uid) + 1);
if (!p)
@@ -1725,7 +1725,7 @@ static const char *table_data_format(Table *t, TableData *d, bool avoid_uppercas
char *p;
if (!gid_is_valid(d->gid))
return "n/a";
return "-";
p = new(char, DECIMAL_STR_WIDTH(d->gid) + 1);
if (!p)
@@ -1740,7 +1740,7 @@ static const char *table_data_format(Table *t, TableData *d, bool avoid_uppercas
char *p;
if (!pid_is_valid(d->pid))
return "n/a";
return "-";
p = new(char, DECIMAL_STR_WIDTH(d->pid) + 1);
if (!p)
@@ -1757,7 +1757,7 @@ static const char *table_data_format(Table *t, TableData *d, bool avoid_uppercas
suffix = signal_to_string(d->int_val);
if (!suffix)
return "n/a";
return "-";
p = strjoin("SIG", suffix);
if (!p)
@@ -1771,7 +1771,7 @@ static const char *table_data_format(Table *t, TableData *d, bool avoid_uppercas
char *p;
if (d->mode == MODE_INVALID)
return "n/a";
return "-";
p = new(char, 4 + 1);
if (!p)