diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-14 19:22:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-14 19:22:58 +0000 |
commit | 764402d8b945f7abbfa5f68a6d16c94c635f7ffe (patch) | |
tree | f04a9feedef2357ee3aa9b9eef439447f76f14c3 /misc-utils/findmnt.c | |
parent | Adding debian version 2.40-8. (diff) | |
download | util-linux-764402d8b945f7abbfa5f68a6d16c94c635f7ffe.tar.xz util-linux-764402d8b945f7abbfa5f68a6d16c94c635f7ffe.zip |
Merging upstream version 2.40.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | misc-utils/findmnt.c | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/misc-utils/findmnt.c b/misc-utils/findmnt.c index cc397da..f40b137 100644 --- a/misc-utils/findmnt.c +++ b/misc-utils/findmnt.c @@ -552,7 +552,6 @@ static char *get_vfs_attr(struct libmnt_fs *fs, int sizetype) static char *get_data_col_sources(struct libmnt_fs *fs, int evaluate, size_t *datasiz) { const char *tag = NULL, *p = NULL; - int i = 0; const char *device = NULL; char *val = NULL; blkid_dev_iterate iter; @@ -602,10 +601,8 @@ static char *get_data_col_sources(struct libmnt_fs *fs, int evaluate, size_t *da dev = blkid_verify(blk_cache, dev); if (!dev) continue; - if (i != 0) - ul_buffer_append_data(&buf, "\0", 1); ul_buffer_append_string(&buf, blkid_dev_devname(dev)); - i++; + ul_buffer_append_data(&buf, "\0", 1); } blkid_dev_iterate_end(iter); free(val); @@ -1636,7 +1633,7 @@ int main(int argc, char *argv[]) break; case 'I': flags &= ~FL_TREE; - flags |= FL_DF_INODES; + flags |= (FL_DF_INODES | FL_DF); break; case 'i': flags |= FL_INVERT; @@ -1775,22 +1772,20 @@ int main(int argc, char *argv[]) if (collist) list_colunms(); /* print end exit */ - if (!ncolumns && (flags & FL_DF_INODES)) { + if (!ncolumns && (flags & FL_DF)) { add_column(columns, ncolumns++, COL_SOURCE); add_column(columns, ncolumns++, COL_FSTYPE); - add_column(columns, ncolumns++, COL_INO_TOTAL); - add_column(columns, ncolumns++, COL_INO_USED); - add_column(columns, ncolumns++, COL_INO_AVAIL); - add_column(columns, ncolumns++, COL_INO_USEPERC); - add_column(columns, ncolumns++, COL_TARGET); - } - else if (!ncolumns && (flags & FL_DF)) { - add_column(columns, ncolumns++, COL_SOURCE); - add_column(columns, ncolumns++, COL_FSTYPE); - add_column(columns, ncolumns++, COL_SIZE); - add_column(columns, ncolumns++, COL_USED); - add_column(columns, ncolumns++, COL_AVAIL); - add_column(columns, ncolumns++, COL_USEPERC); + if (flags & FL_DF_INODES) { + add_column(columns, ncolumns++, COL_INO_TOTAL); + add_column(columns, ncolumns++, COL_INO_USED); + add_column(columns, ncolumns++, COL_INO_AVAIL); + add_column(columns, ncolumns++, COL_INO_USEPERC); + } else { + add_column(columns, ncolumns++, COL_SIZE); + add_column(columns, ncolumns++, COL_USED); + add_column(columns, ncolumns++, COL_AVAIL); + add_column(columns, ncolumns++, COL_USEPERC); + } add_column(columns, ncolumns++, COL_TARGET); } |