- (void) newmode(0);
- for (i = 1; i < argc; i++) {
- p = argv[i];
- if (stat(p, &st) < 0) {
- fprintf(stderr, "chmod: can't access %s\n", p);
- ++status;
- continue;
- }
- if (rflag && st.st_mode & S_IFDIR) {
- status += chmodr(p, newmode(st.st_mode));
- } else if (chmod(p, newmode(st.st_mode)) < 0) {
- fprintf(stderr, "chmod: can't change %s\n", p);
- ++status;
- continue;
- }
- }
- exit(status);