summaryrefslogtreecommitdiffstats
path: root/util.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2021-01-27 15:27:56 -0500
committerTavian Barnes <tavianator@tavianator.com>2021-01-28 17:13:26 -0500
commit9bf75cee19b8d60d2b4f6260a8c2322cc8ca11db (patch)
tree0bc819909cb616b05ff013fbf1144dae7a13ec23 /util.c
parent3fcd7b010fd4f477582997d688cc415f76e70411 (diff)
downloadbfs-9bf75cee19b8d60d2b4f6260a8c2322cc8ca11db.tar.xz
dir: New DIR* facade
Diffstat (limited to 'util.c')
-rw-r--r--util.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/util.c b/util.c
index 3ba8053..32d8c76 100644
--- a/util.c
+++ b/util.c
@@ -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;