int do_change(char *name)
{
mode_t m;
- DIR dir;
+ DIR *dir;
struct dirent *entp;
char *namp;
}
if (S_ISDIR(st.st_mode) && rflag) {
- if (!opendir_r(&dir, name)) {
+ if ((dir = opendir(name)) == NULL) {
perror(name);
return (1);
}
strcpy(path, name);
namp = path + strlen(path);
*namp++ = '/';
- while (entp = readdir(&dir))
+ while (entp = readdir(dir))
if (entp->d_name[0] != '.' ||
(entp->d_name[1] &&
(entp->d_name[1] != '.' || entp->d_name[2]))) {
strcpy(namp, entp->d_name);
errors |= do_change(path);
}
- closedir_r(&dir);
+ closedir(dir);
*--namp = '\0';
}
return (errors);
/* Write any error message */
if (s != (const char *) NULL)
write(fderr, s, strlen(s));
- exit((s == (char *) NULL) ? 0 : 1);
+ exit((s == (const char *) NULL) ? 0 : 1);
}
}
}
}
+ return 0;
}