From 7761bd3bb6c56a375ad8d027c20d020aaa33e2d8 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 11 Apr 2019 13:11:53 +0200 Subject: lib/fileutils: add xreaddir() Remove duplicate code and keep only one implementation in include/fileutils.h. Signed-off-by: Karel Zak --- misc-utils/lsblk.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'misc-utils') 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) { -- cgit v1.2.3-55-g7522