SCCS-vsn: usr.bin/xinstall/xinstall.c 5.22
SCCS-vsn: bin/chmod/chmod.c 5.10
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)chmod.c 5.9 (Berkeley) %G%";
+static char sccsid[] = "@(#)chmod.c 5.10 (Berkeley) %G%";
#endif /* not lint */
#include <sys/types.h>
#endif /* not lint */
#include <sys/types.h>
register FTSENT *p;
register int oct, omode;
register char *mode;
register FTSENT *p;
register int oct, omode;
register char *mode;
+ mode_t *set, *setmode();
struct stat sb;
int ch, fflag, rflag;
struct stat sb;
int ch, fflag, rflag;
omode = (int)strtol(mode, (char **)NULL, 8);
oct = 1;
} else {
omode = (int)strtol(mode, (char **)NULL, 8);
oct = 1;
} else {
- if (setmode(mode) == -1) {
+ if (!(set = setmode(mode))) {
(void)fprintf(stderr, "chmod: invalid file mode.\n");
exit(1);
}
(void)fprintf(stderr, "chmod: invalid file mode.\n");
exit(1);
}
error(p->path);
continue;
}
error(p->path);
continue;
}
- if (chmod(p->accpath,
- oct ? omode : getmode(p->statb.st_mode) && !fflag))
+ if (chmod(p->accpath, oct ?
+ omode : getmode(set, p->statb.st_mode) && !fflag))
error(p->path);
}
exit(retval);
error(p->path);
}
exit(retval);
} else
while (*++argv)
if ((lstat(*argv, &sb) ||
} else
while (*++argv)
if ((lstat(*argv, &sb) ||
- chmod(*argv, getmode(sb.st_mode))) && !fflag)
+ chmod(*argv, getmode(set, sb.st_mode))) && !fflag)
error(*argv);
exit(retval);
}
error(*argv);
exit(retval);
}
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)xinstall.c 5.21 (Berkeley) %G%";
+static char sccsid[] = "@(#)xinstall.c 5.22 (Berkeley) %G%";
#endif /* not lint */
#include <sys/param.h>
#endif /* not lint */
#include <sys/param.h>
extern char *optarg;
extern int optind;
struct stat from_sb, to_sb;
extern char *optarg;
extern int optind;
struct stat from_sb, to_sb;
+ mode_t *set, *setmode();
int ch, no_target;
char *to_name;
int ch, no_target;
char *to_name;
group = optarg;
break;
case 'm':
group = optarg;
break;
case 'm':
- if (setmode(optarg) == -1) {
+ if (!(set = setmode(optarg))) {
(void)fprintf(stderr,
"install: invalid file mode.\n");
exit(1);
}
(void)fprintf(stderr,
"install: invalid file mode.\n");
exit(1);
}
+ mode = getmode(set, 0);
break;
case 'o':
owner = optarg;
break;
case 'o':
owner = optarg;