diff options
author | Daniel Mack <github@zonque.org> | 2015-10-23 10:50:53 +0200 |
---|---|---|
committer | Daniel Mack <github@zonque.org> | 2015-10-23 10:50:53 +0200 |
commit | 952b4473bc392652b1d4c9dae5ec88fd003c4e1d (patch) | |
tree | 8d27afa9b27ceb997013868f2b80a4bb5a993911 /src/basic/util.c | |
parent | c9fc270e462bf2f4eab963bf71234d64b0c4c30f (diff) | |
parent | b0830e21f47109d8a6ba2fc0afbf9b2ca1ffc2a9 (diff) |
Merge pull request #1641 from poettering/btrfs-quota
btrfs quota beef up and various other unrelated changes
Diffstat (limited to 'src/basic/util.c')
-rw-r--r-- | src/basic/util.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/basic/util.c b/src/basic/util.c index 3989b415fa..ec3b360ffe 100644 --- a/src/basic/util.c +++ b/src/basic/util.c @@ -2381,25 +2381,16 @@ bool is_device_path(const char *path) { int dir_is_empty(const char *path) { _cleanup_closedir_ DIR *d; + struct dirent *de; d = opendir(path); if (!d) return -errno; - for (;;) { - struct dirent *de; - - errno = 0; - de = readdir(d); - if (!de && errno != 0) - return -errno; - - if (!de) - return 1; + FOREACH_DIRENT(de, d, return -errno) + return 0; - if (!hidden_file(de->d_name)) - return 0; - } + return 1; } char* dirname_malloc(const char *path) { |