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 /lib/sysfs.c | |
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 'lib/sysfs.c')
-rw-r--r-- | lib/sysfs.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/lib/sysfs.c b/lib/sysfs.c index eee082753..b51a4ff26 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -10,6 +10,7 @@ #include "at.h" #include "pathnames.h" #include "sysfs.h" +#include "fileutils.h" char *sysfs_devno_attribute_path(dev_t devno, char *buf, size_t bufsiz, const char *attr) @@ -510,17 +511,6 @@ char *sysfs_get_devname(struct sysfs_cxt *cxt, char *buf, size_t bufsiz) return buf; } -/* returns basename and keeps dirname in the @path */ -static char *stripoff_last_component(char *path) -{ - char *p = strrchr(path, '/'); - - if (!p) - return NULL; - *p = '\0'; - return ++p; -} - static int get_dm_wholedisk(struct sysfs_cxt *cxt, char *diskname, size_t len, dev_t *diskdevno) { |