/* Cydia - iPhone UIKit Front-End for Debian APT
- * Copyright (C) 2008-2014 Jay Freeman (saurik)
+ * Copyright (C) 2008-2015 Jay Freeman (saurik)
*/
/* GNU General Public License, Version 3 {{{ */
} \
} _value; })
-int $getdirentries(int, char *, int, long *) __asm("_getdirentries");
-
-struct $dirent {
- __uint32_t d_ino;
- __uint16_t d_reclen;
- __uint8_t d_type;
- __uint8_t d_namlen;
- char d_name[__DARWIN_MAXNAMLEN + 1];
-};
-
-#define getdirentries $getdirentries
-#define dirent $dirent
+extern "C" int __getdirentries64(int, char *, int, long *);
enum Recurse {
RecurseYes,
if (recurse == RecurseYes)
for (long address(0);;) {
char buffer[4096];
- int size(_syscall(getdirentries(fd, buffer, sizeof(buffer), &address)));
+ int size(_syscall(__getdirentries64(fd, buffer, sizeof(buffer), &address)));
if (size == 0)
break;
const char *name(dir->d_name);
size_t after(strlen(name));
- if (false);
+ if (dir->d_ino == 0);
else if (after == 1 && name[0] == '.');
else if (after == 2 && name[0] == '.' && name[1] == '.');
else {
return -1;
case DT_DIR:
- setnsfpn(sub, both, RecurseYes);
+ if (setnsfpn(sub, both, RecurseYes) != 0)
+ return -1;
break;
case DT_REG:
- setnsfpn(sub, both, RecurseNo);
+ if (setnsfpn(sub, both, RecurseNo) != 0)
+ return -1;
break;
}
}