Mon, 04 Aug 2014 12:53:36 +0200
replaced readdir_r with readdir
dav/sync.c | file | annotate | diff | comparison | revisions |
--- a/dav/sync.c Mon Aug 04 12:32:12 2014 +0200 +++ b/dav/sync.c Mon Aug 04 12:53:36 2014 +0200 @@ -441,17 +441,8 @@ if(!local_dir) { fprintf(stderr, "Cannot open directory %s\n", local_path); } else { -#ifdef _WIN32 - long namemax = 255; -#else - long namemax = namemax = pathconf(path, _PC_NAME_MAX); -#endif - if(namemax == 0) { - namemax = 255; - } - struct dirent *ent = malloc(sizeof(struct dirent) + namemax + 1); - struct dirent *res = NULL; - while(!readdir_r(local_dir, ent, &res) && res) { + struct dirent *ent; + while((ent = readdir(local_dir)) != NULL) { if(!strcmp(ent->d_name, ".") || !strcmp(ent->d_name, "..")) { continue; } @@ -469,7 +460,7 @@ } } closedir(local_dir); - free(ent); + } free(local_path); free(p);