diff options
| author | Karel Zak <kzak@redhat.com> | 2019-04-11 13:11:53 +0200 |
|---|---|---|
| committer | Karel Zak <kzak@redhat.com> | 2019-04-11 13:11:53 +0200 |
| commit | 7761bd3bb6c56a375ad8d027c20d020aaa33e2d8 (patch) | |
| tree | 1c5a07da00a32e8b6dbde0eef1500f48ef340af2 /misc-utils/lsblk.c | |
| parent | 146900d41166efc375d69d7a51f9675dba684f6a (diff) | |
| download | util-linux-7761bd3bb6c56a375ad8d027c20d020aaa33e2d8.tar.gz | |
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/lsblk.c')
| -rw-r--r-- | misc-utils/lsblk.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/misc-utils/lsblk.c b/misc-utils/lsblk.c index ad5af4721f..915a062baa 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) { |
