summaryrefslogtreecommitdiffstats
path: root/misc-utils
diff options
context:
space:
mode:
authorKarel Zak2019-04-11 13:11:53 +0200
committerKarel Zak2019-04-11 13:11:53 +0200
commit7761bd3bb6c56a375ad8d027c20d020aaa33e2d8 (patch)
tree1c5a07da00a32e8b6dbde0eef1500f48ef340af2 /misc-utils
parentsetarch: add new e2k subarches (diff)
downloadkernel-qcow2-util-linux-7761bd3bb6c56a375ad8d027c20d020aaa33e2d8.tar.gz
kernel-qcow2-util-linux-7761bd3bb6c56a375ad8d027c20d020aaa33e2d8.tar.xz
kernel-qcow2-util-linux-7761bd3bb6c56a375ad8d027c20d020aaa33e2d8.zip
lib/fileutils: add xreaddir()
Remove duplicate code and keep only one implementation in include/fileutils.h. Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils')
-rw-r--r--misc-utils/lsblk.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/misc-utils/lsblk.c b/misc-utils/lsblk.c
index ad5af4721..915a062ba 100644
--- a/misc-utils/lsblk.c
+++ b/misc-utils/lsblk.c
@@ -49,6 +49,7 @@
#include "sysfs.h"
#include "closestream.h"
#include "optutils.h"
+#include "fileutils.h"
#include "lsblk.h"
@@ -328,24 +329,6 @@ static int is_dm(const char *name)
return strncmp(name, "dm-", 3) ? 0 : 1;
}
-/* This is readdir()-like function, but skips "." and ".." directory entries */
-static struct dirent *xreaddir(DIR *dp)
-{
- struct dirent *d;
-
- assert(dp);
-
- while ((d = readdir(dp))) {
- if (!strcmp(d->d_name, ".") ||
- !strcmp(d->d_name, ".."))
- continue;
-
- /* blacklist here? */
- break;
- }
- return d;
-}
-
/* Returns full pat to the device node (TODO: what about sysfs_blkdev_get_path()) */
static char *get_device_path(struct lsblk_device *dev)
{