From: Alan Cox Date: Thu, 23 Nov 2017 23:04:49 +0000 (+0000) Subject: du: 6502 support X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=b138a3a01f797519d96af12f7e8ea2e3c6c9ad11;p=FUZIX.git du: 6502 support --- diff --git a/Applications/util/du.c b/Applications/util/du.c index 5f505179..4d841ad7 100644 --- a/Applications/util/du.c +++ b/Applications/util/du.c @@ -129,7 +129,7 @@ long dodir(char *d, int thislev, dev_t dev) int maybe_print; struct stat s; long total; - DIR dir; + DIR *dir; struct dirent *entry; static char dent[LINELEN]; @@ -155,8 +155,8 @@ long dodir(char *d, int thislev, dev_t dev) * directory should not already have been done. */ maybe_print = !silent; - if (opendir_r(&dir, d) == NULL) break; - while ((entry = readdir(&dir)) != NULL) { + if (dir = opendir(d) == NULL) break; + while ((entry = readdir(dir)) != NULL) { if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0) continue; @@ -164,7 +164,7 @@ long dodir(char *d, int thislev, dev_t dev) continue; total += dodir(dent, thislev - 1, s.st_dev); } - closedir_r(&dir); + closedir(dir); break; case S_IFBLK: