From c667aff93fb9f16121fcb1ed32f557949dab3eee Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 10 Sep 2012 10:30:11 +0200 Subject: libmount: improve mnt_table_get_root_fs() docs Fix info about return value, improve description. Reported-by: Amit Signed-off-by: Karel Zak --- libmount/src/tab.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'libmount/src/tab.c') diff --git a/libmount/src/tab.c b/libmount/src/tab.c index 1c159b56f..bac6cf87b 100644 --- a/libmount/src/tab.c +++ b/libmount/src/tab.c @@ -210,7 +210,18 @@ int mnt_table_remove_fs(struct libmnt_table *tb, struct libmnt_fs *fs) * @tb: mountinfo file (/proc/self/mountinfo) * @root: returns pointer to the root filesystem (/) * - * Returns: 0 on success or -1 case of error. + * The function uses parent ID from mountinfo file to determine root filesystem + * (the filesystem with the smallest ID). The function is designed mostly for + * applications where is necessary to sort mountpoints by IDs to get the tree + * of the mountpoints (e.g. findmnt default output). + * + * If you're not sure than use + * + * mnt_table_find_target(tb, "/", MNT_ITER_BACKWARD); + * + * this is more robust and usable for arbitrary tab file (including fstab). + * + * Returns: 0 on success or less then zero case of error. */ int mnt_table_get_root_fs(struct libmnt_table *tb, struct libmnt_fs **root) { -- cgit v1.2.3-55-g7522