diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-05-06 02:43:04 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-05-06 02:43:04 +0000 |
commit | 4e506c9aefe5b89970ae6894d05ad53c81af0d83 (patch) | |
tree | 2fac98df209e72eaba773cad2d7b90c99d9d9249 /mdk-stage1/dietlibc/lib/ftw.c | |
parent | 793707b39bf2e9df40a6d2d60b83b3061088ae9e (diff) | |
download | drakx-backup-do-not-use-4e506c9aefe5b89970ae6894d05ad53c81af0d83.tar drakx-backup-do-not-use-4e506c9aefe5b89970ae6894d05ad53c81af0d83.tar.gz drakx-backup-do-not-use-4e506c9aefe5b89970ae6894d05ad53c81af0d83.tar.bz2 drakx-backup-do-not-use-4e506c9aefe5b89970ae6894d05ad53c81af0d83.tar.xz drakx-backup-do-not-use-4e506c9aefe5b89970ae6894d05ad53c81af0d83.zip |
use installed dietlibc, not our forked cvs version
Diffstat (limited to 'mdk-stage1/dietlibc/lib/ftw.c')
-rw-r--r-- | mdk-stage1/dietlibc/lib/ftw.c | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/mdk-stage1/dietlibc/lib/ftw.c b/mdk-stage1/dietlibc/lib/ftw.c deleted file mode 100644 index af13a7f86..000000000 --- a/mdk-stage1/dietlibc/lib/ftw.c +++ /dev/null @@ -1,47 +0,0 @@ -#include <sys/stat.h> -#include <unistd.h> -#include <limits.h> -#include <ftw.h> -#include <dirent.h> -#include <string.h> -#include <stdlib.h> -#include "dietdirent.h" - -int ftw(const char*dir,int(*f)(const char*file,const struct stat*sb,int flag),int dpth){ - char* cd; - size_t cdl; - DIR* d; - struct dirent* de; - struct stat sb; - int r; - unsigned int oldlen=0; - char* filename; /* the warning gcc issues here is bogus */ - if(chdir(dir))return-1; - cd=alloca(PATH_MAX+1); - if(!getcwd(cd,PATH_MAX))return-1; - cd[PATH_MAX]='\0'; - cdl=strlen(cd); - if(!(d=opendir(".")))return-1; - while((de=readdir(d))){ - int flg; - size_t nl; - if(de->d_name[0]=='.'){if(!de->d_name[1])continue;if(de->d_name[1]=='.'&&!de->d_name[2])continue;} - nl=strlen(de->d_name); - if (nl+cdl+2>oldlen) - filename=alloca(oldlen=nl+cdl+2); - memmove(filename,cd,cdl); - filename[cdl]='/'; - memmove(filename+cdl+1,de->d_name,nl+1); - if(!lstat(de->d_name,&sb)){ - if(S_ISLNK(sb.st_mode))flg=FTW_SL;else if(S_ISDIR(sb.st_mode))flg=FTW_D;else flg=FTW_F; - }else flg=FTW_NS; - r=f(filename,&sb,flg); - if(r){closedir(d);return r;} - if(flg==FTW_D&&dpth){ - r=ftw(filename,f,dpth-1); - fchdir(d->fd); - if (r){closedir(d);return r;} - } - } - return closedir(d); -} |