core,format-table: use strna/ersatz for formatting fdstore dump

Currently, the code doesn't handle anonymous inodes correctly.
This commit is contained in:
Mike Yuan
2023-12-25 17:47:18 +08:00
parent 2413a0fab4
commit 8ba111463d
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -903,12 +903,12 @@ static void service_dump_fdstore(Service *s, FILE *f, const char *prefix) {
"%s%s '%s' (type=%s; dev=" DEVNUM_FORMAT_STR "; inode=%" PRIu64 "; rdev=" DEVNUM_FORMAT_STR "; path=%s; access=%s)\n",
prefix, i == s->fd_store ? "File Descriptor Store Entry:" : " ",
i->fdname,
inode_type_to_string(st.st_mode),
strna(inode_type_to_string(st.st_mode)),
DEVNUM_FORMAT_VAL(st.st_dev),
(uint64_t) st.st_ino,
DEVNUM_FORMAT_VAL(st.st_rdev),
strna(path),
accmode_to_string(flags));
strna(accmode_to_string(flags)));
}
}
+1 -1
View File
@@ -2003,7 +2003,7 @@ static const char *table_data_format(Table *t, TableData *d, bool avoid_uppercas
if (d->mode == MODE_INVALID)
return table_ersatz_string(t);
return inode_type_to_string(d->mode);
return inode_type_to_string(d->mode) ?: table_ersatz_string(t);
case TABLE_DEVNUM:
if (devnum_is_zero(d->devnum))