]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: improve mnt_table_get_root_fs() docs
authorKarel Zak <kzak@redhat.com>
Mon, 10 Sep 2012 08:30:11 +0000 (10:30 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 10 Sep 2012 08:30:11 +0000 (10:30 +0200)
Fix info about return value, improve description.

Reported-by: Amit <amit.uttam@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/tab.c

index 1c159b56fbf9cab8c387716510097a439085ae81..bac6cf87b6e581a3a27f229bf4dbb1c2bd169433 100644 (file)
@@ -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)
 {