diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2021-01-27 15:27:56 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2021-01-28 17:13:26 -0500 |
commit | 9bf75cee19b8d60d2b4f6260a8c2322cc8ca11db (patch) | |
tree | 0bc819909cb616b05ff013fbf1144dae7a13ec23 /util.c | |
parent | 3fcd7b010fd4f477582997d688cc415f76e70411 (diff) | |
download | bfs-9bf75cee19b8d60d2b4f6260a8c2322cc8ca11db.tar.xz |
dir: New DIR* facade
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 18 |
1 files changed, 0 insertions, 18 deletions
@@ -39,24 +39,6 @@ # include <sys/mkdev.h> #endif -int xreaddir(DIR *dir, struct dirent **de) { - while (true) { - errno = 0; - *de = readdir(dir); - - if (*de) { - const char *name = (*de)->d_name; - if (name[0] != '.' || (name[1] != '\0' && (name[1] != '.' || name[2] != '\0'))) { - return 0; - } - } else if (errno != 0) { - return -1; - } else { - return 0; - } - } -} - char *xreadlinkat(int fd, const char *path, size_t size) { ssize_t len; char *name = NULL; |