diff options
-rw-r--r-- | shlibs/mount/src/fs.c | 16 | ||||
-rw-r--r-- | shlibs/mount/src/mount.h.in | 2 | ||||
-rw-r--r-- | shlibs/mount/src/mount.sym | 6 | ||||
-rw-r--r-- | shlibs/mount/src/mountP.h | 2 | ||||
-rw-r--r-- | shlibs/mount/src/tab_parse.c | 4 |
5 files changed, 24 insertions, 6 deletions
diff --git a/shlibs/mount/src/fs.c b/shlibs/mount/src/fs.c index 63da2f206..c8677c702 100644 --- a/shlibs/mount/src/fs.c +++ b/shlibs/mount/src/fs.c @@ -51,7 +51,7 @@ void mnt_free_fs(mnt_fs *fs) free(fs->source); free(fs->tagname); free(fs->tagval); - free(fs->mntroot); + free(fs->root); free(fs->target); free(fs->fstype); free(fs->optstr); @@ -448,6 +448,18 @@ int mnt_fs_set_passno(mnt_fs *fs, int passno) } /** + * mnt_fs_get_root: + * @fs: /proc/self/mountinfo entry + * + * Returns: root of the mount within the filesystem or NULL + */ +const char *mnt_fs_get_root(mnt_fs *fs) +{ + assert(fs); + return fs ? fs->root : NULL; +} + +/** * mnt_fs_get_id: * @fs: /proc/self/mountinfo entry * @@ -475,7 +487,7 @@ int mnt_fs_get_parent_id(mnt_fs *fs) /** * mnt_fs_get_devno: - * @fs: /proc/self/mountinfo + * @fs: /proc/self/mountinfo entry * * Returns: value of st_dev for files on filesystem or 0 in case of error. */ diff --git a/shlibs/mount/src/mount.h.in b/shlibs/mount/src/mount.h.in index 6e76ddb28..d42ab1d62 100644 --- a/shlibs/mount/src/mount.h.in +++ b/shlibs/mount/src/mount.h.in @@ -31,7 +31,6 @@ extern "C" { #include <stdio.h> - #define LIBMOUNT_VERSION "@LIBMOUNT_VERSION@" /** @@ -236,6 +235,7 @@ extern int mnt_fs_get_freq(mnt_fs *ent); extern int mnt_fs_set_freq(mnt_fs *ent, int freq); extern int mnt_fs_get_passno(mnt_fs *ent); extern int mnt_fs_set_passno(mnt_fs *ent, int passno); +extern const char *mnt_fs_get_root(mnt_fs *fs); extern int mnt_fs_get_id(mnt_fs *fs); extern int mnt_fs_get_parent_id(mnt_fs *fs); extern dev_t mnt_fs_get_devno(mnt_fs *fs); diff --git a/shlibs/mount/src/mount.sym b/shlibs/mount/src/mount.sym index f3c10689a..c4aa8e4f9 100644 --- a/shlibs/mount/src/mount.sym +++ b/shlibs/mount/src/mount.sym @@ -133,3 +133,9 @@ global: local: *; }; + + +MOUNT_2.19 { +global: + mnt_fs_get_root; +} MOUNT_2.18; diff --git a/shlibs/mount/src/mountP.h b/shlibs/mount/src/mountP.h index d217e3da3..04084e5d1 100644 --- a/shlibs/mount/src/mountP.h +++ b/shlibs/mount/src/mountP.h @@ -133,7 +133,7 @@ struct _mnt_fs { char *tagname; /* fstab[1]: tag name - "LABEL", "UUID", ..*/ char *tagval; /* tag value */ - char *mntroot; /* mountinfo[4]: root of the mount within the FS */ + char *root; /* mountinfo[4]: root of the mount within the FS */ char *target; /* mountinfo[5], fstab[2]: mountpoint */ char *fstype; /* mountinfo[9], fstab[3]: filesystem type */ diff --git a/shlibs/mount/src/tab_parse.c b/shlibs/mount/src/tab_parse.c index e7cc7ef49..06bb64862 100644 --- a/shlibs/mount/src/tab_parse.c +++ b/shlibs/mount/src/tab_parse.c @@ -168,8 +168,8 @@ static int mnt_parse_mountinfo_line(mnt_fs *fs, char *s) next_word_skip(&s); /* MOUNTROOT */ - fs->mntroot = next_word(&s); - if (!fs->mntroot) + fs->root = next_word(&s); + if (!fs->root) return 1; /* TARGET (mountpoit) */ |