diff options
author | Karel Zak | 2014-06-09 11:54:32 +0200 |
---|---|---|
committer | Karel Zak | 2014-06-09 11:54:32 +0200 |
commit | d4eaabc86ad36af8f2d0e37ebfc56d53d5a8a21d (patch) | |
tree | e400911d82bef85e70d7316099a92ab3e1227435 /libmount | |
parent | lib/fileutils: add mkdir_p() from libmount (diff) | |
download | kernel-qcow2-util-linux-d4eaabc86ad36af8f2d0e37ebfc56d53d5a8a21d.tar.gz kernel-qcow2-util-linux-d4eaabc86ad36af8f2d0e37ebfc56d53d5a8a21d.tar.xz kernel-qcow2-util-linux-d4eaabc86ad36af8f2d0e37ebfc56d53d5a8a21d.zip |
lib/fileutils: add stripoff_last_component() from libmount
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount')
-rw-r--r-- | libmount/src/mountP.h | 4 | ||||
-rw-r--r-- | libmount/src/tab.c | 1 | ||||
-rw-r--r-- | libmount/src/utils.c | 12 |
3 files changed, 1 insertions, 16 deletions
diff --git a/libmount/src/mountP.h b/libmount/src/mountP.h index eaaffa281..d85a078de 100644 --- a/libmount/src/mountP.h +++ b/libmount/src/mountP.h @@ -79,16 +79,12 @@ extern int mnt_run_test(struct libmnt_test *tests, int argc, char *argv[]); #endif /* utils.c */ -extern char *stripoff_last_component(char *path); - extern int mnt_valid_tagname(const char *tagname); extern int append_string(char **a, const char *b); extern const char *mnt_statfs_get_fstype(struct statfs *vfs); extern int is_file_empty(const char *name); -extern int mkdir_p(const char *path, mode_t mode); - extern int mnt_is_readonly(const char *path) __attribute__((nonnull)); diff --git a/libmount/src/tab.c b/libmount/src/tab.c index 86d682a0f..77260ab96 100644 --- a/libmount/src/tab.c +++ b/libmount/src/tab.c @@ -46,6 +46,7 @@ #include "mountP.h" #include "strutils.h" #include "loopdev.h" +#include "fileutils.h" static int is_mountinfo(struct libmnt_table *tb) { diff --git a/libmount/src/utils.c b/libmount/src/utils.c index 7700d805a..d97390e94 100644 --- a/libmount/src/utils.c +++ b/libmount/src/utils.c @@ -117,18 +117,6 @@ static int fstype_cmp(const void *v1, const void *v2) return strcmp(s1, s2); } -/* returns basename and keeps dirname in the @path, if @path is "/" (root) - * then returns empty string */ -char *stripoff_last_component(char *path) -{ - char *p = path ? strrchr(path, '/') : NULL; - - if (!p) - return NULL; - *p = '\0'; - return p + 1; -} - /* * Note that the @target has to be an absolute path (so at least "/"). The * @filename returns an allocated buffer with the last path component, for example: |