lsfd: add MODE column

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
This commit is contained in:
Masatake YAMATO 2021-05-06 14:29:43 +09:00 committed by Karel Zak
parent 22b7cf51cc
commit 17adf20f12
3 changed files with 18 additions and 1 deletions

View file

@ -244,6 +244,14 @@ static bool file_fill_column(struct proc *proc,
case COL_MNT_ID:
xasprintf(&str, "%d", file->association < 0? 0: file->mnt_id);
break;
case COL_MODE:
if (file->association < 0)
xasprintf(&str, "---");
else
xasprintf(&str, "%c%c-",
file->mode & S_IRUSR? 'r': '-',
file->mode & S_IWUSR? 'w': '-');
break;
case COL_POS:
xasprintf(&str, "%llu",
file->association < 0? 0: file->pos);