Deleted Added
full compact
chmod.c (77522) chmod.c (90107)
1/*
2 * Copyright (c) 1989, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 28 unchanged lines hidden (view full) ---

37 The Regents of the University of California. All rights reserved.\n";
38#endif /* not lint */
39
40#ifndef lint
41#if 0
42static char sccsid[] = "@(#)chmod.c 8.8 (Berkeley) 4/1/94";
43#endif
44static const char rcsid[] =
1/*
2 * Copyright (c) 1989, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 28 unchanged lines hidden (view full) ---

37 The Regents of the University of California. All rights reserved.\n";
38#endif /* not lint */
39
40#ifndef lint
41#if 0
42static char sccsid[] = "@(#)chmod.c 8.8 (Berkeley) 4/1/94";
43#endif
44static const char rcsid[] =
45 "$FreeBSD: head/bin/chmod/chmod.c 77522 2001-05-31 11:47:20Z ru $";
45 "$FreeBSD: head/bin/chmod/chmod.c 90107 2002-02-02 06:15:22Z imp $";
46#endif /* not lint */
47
48#include <sys/types.h>
49#include <sys/stat.h>
50
51#include <err.h>
52#include <errno.h>
53#include <fts.h>
54#include <limits.h>
55#include <stdio.h>
56#include <stdlib.h>
57#include <string.h>
58#include <unistd.h>
59
46#endif /* not lint */
47
48#include <sys/types.h>
49#include <sys/stat.h>
50
51#include <err.h>
52#include <errno.h>
53#include <fts.h>
54#include <limits.h>
55#include <stdio.h>
56#include <stdlib.h>
57#include <string.h>
58#include <unistd.h>
59
60int main __P((int, char *[]));
61void usage __P((void));
60int main(int, char *[]);
61void usage(void);
62
63int
62
63int
64main(argc, argv)
65 int argc;
66 char *argv[];
64main(int argc, char *argv[])
67{
68 FTS *ftsp;
69 FTSENT *p;
70 mode_t *set;
71 long val;
72 int oct, omode;
73 int Hflag, Lflag, Pflag, Rflag, ch, fflag, fts_options, hflag, rval;
74 int vflag;
75 char *ep, *mode;
76 int newmode;
65{
66 FTS *ftsp;
67 FTSENT *p;
68 mode_t *set;
69 long val;
70 int oct, omode;
71 int Hflag, Lflag, Pflag, Rflag, ch, fflag, fts_options, hflag, rval;
72 int vflag;
73 char *ep, *mode;
74 int newmode;
77 int (*change_mode) __P((const char *, mode_t));
75 int (*change_mode)(const char *, mode_t);
78
79 set = NULL;
80 omode = 0;
81 Hflag = Lflag = Pflag = Rflag = fflag = hflag = vflag = 0;
82 while ((ch = getopt(argc, argv, "HLPRXfghorstuvwx")) != -1)
83 switch (ch) {
84 case 'H':
85 Hflag = 1;

--- 131 unchanged lines hidden (view full) ---

217 }
218 if (errno)
219 err(1, "fts_read");
220 free(set);
221 exit(rval);
222}
223
224void
76
77 set = NULL;
78 omode = 0;
79 Hflag = Lflag = Pflag = Rflag = fflag = hflag = vflag = 0;
80 while ((ch = getopt(argc, argv, "HLPRXfghorstuvwx")) != -1)
81 switch (ch) {
82 case 'H':
83 Hflag = 1;

--- 131 unchanged lines hidden (view full) ---

215 }
216 if (errno)
217 err(1, "fts_read");
218 free(set);
219 exit(rval);
220}
221
222void
225usage()
223usage(void)
226{
227 (void)fprintf(stderr,
228 "usage: chmod [-fhv] [-R [-H | -L | -P]] mode file ...\n");
229 exit(1);
230}
224{
225 (void)fprintf(stderr,
226 "usage: chmod [-fhv] [-R [-H | -L | -P]] mode file ...\n");
227 exit(1);
228}