Removed the error count from sys_rstat() as this can easily happen with

links and can be regarded as an harmless error (maybe it should directly
test for broken links, though).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9523 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2004-10-27 00:48:20 +00:00
parent a7e04f442b
commit 794822a8b5
1 changed files with 49 additions and 52 deletions

View File

@ -416,7 +416,7 @@ do_dir(int argc, char **argv)
{
int dirfd, err, max_err = 10;
char dirname[128], buff[512], time_buf[64] = { '\0', };
size_t len,count = 0;
size_t len, count = 0;
struct my_dirent *dent;
struct my_stat st;
struct tm *tm;
@ -450,13 +450,10 @@ do_dir(int argc, char **argv)
if (err == 0)
break;
err = sys_rstat(1, dirfd, dent->d_name, &st, 1);
if (err != 0) {
// may happen for unresolvable links
printf("stat failed for: %s (%Ld)\n", dent->d_name, dent->d_ino);
if (max_err-- <= 0)
break;
continue;
}
@ -470,9 +467,9 @@ do_dir(int argc, char **argv)
count++;
}
if (err != 0) {
if (err != 0)
printf("readdir failed on: %s\n", dent->d_name);
}
printf("%ld files in directory!\n",count);
sys_closedir(1, dirfd);