View | Details | Raw Unified | Return to bug 191884 | Differences between
and this patch

Collapse All | Expand All

(-)bin/chmod/chmod.1 (+10 lines)
Lines 102-107 Link Here
102
In addition, these options override each other and the
102
In addition, these options override each other and the
103
command's actions are determined by the last one specified.
103
command's actions are determined by the last one specified.
104
.Pp
104
.Pp
105
If
106
.Nm
107
receives a
108
.Dv SIGINFO
109
signal (see the
110
.Cm status
111
argument for
112
.Xr stty 1 ) ,
113
then the current filename as well as the old and new modes are displayed.
114
.Pp
105
Only the owner of a file or the super-user is permitted to change
115
Only the owner of a file or the super-user is permitted to change
106
the mode of a file.
116
the mode of a file.
107
.Sh EXIT STATUS
117
.Sh EXIT STATUS
(-)bin/chmod/chmod.c (-2 / +16 lines)
Lines 48-61 Link Here
48
#include <errno.h>
48
#include <errno.h>
49
#include <fts.h>
49
#include <fts.h>
50
#include <limits.h>
50
#include <limits.h>
51
#include <signal.h>
51
#include <stdio.h>
52
#include <stdio.h>
52
#include <stdlib.h>
53
#include <stdlib.h>
53
#include <string.h>
54
#include <string.h>
54
#include <unistd.h>
55
#include <unistd.h>
55
56
57
static volatile sig_atomic_t siginfo;
58
56
static void usage(void);
59
static void usage(void);
57
static int may_have_nfs4acl(const FTSENT *ent, int hflag);
60
static int may_have_nfs4acl(const FTSENT *ent, int hflag);
58
61
62
static void
63
siginfo_handler(int sig __unused)
64
{
65
66
	siginfo = 1;
67
}
68
59
int
69
int
60
main(int argc, char *argv[])
70
main(int argc, char *argv[])
61
{
71
{
Lines 125-130 Link Here
125
	if (argc < 2)
135
	if (argc < 2)
126
		usage();
136
		usage();
127
137
138
	(void)signal(SIGINFO, siginfo_handler);
139
128
	if (Rflag) {
140
	if (Rflag) {
129
		fts_options = FTS_PHYSICAL;
141
		fts_options = FTS_PHYSICAL;
130
		if (hflag)
142
		if (hflag)
Lines 192-201 Link Here
192
				rval = 1;
204
				rval = 1;
193
			}
205
			}
194
		} else {
206
		} else {
195
			if (vflag) {
207
			if (vflag || siginfo) {
196
				(void)printf("%s", p->fts_path);
208
				(void)printf("%s", p->fts_path);
197
209
198
				if (vflag > 1) {
210
				if (vflag > 1 || siginfo) {
199
					char m1[12], m2[12];
211
					char m1[12], m2[12];
200
212
201
					strmode(p->fts_statp->st_mode, m1);
213
					strmode(p->fts_statp->st_mode, m1);
Lines 207-212 Link Here
207
					    newmode, m2);
219
					    newmode, m2);
208
				}
220
				}
209
				(void)printf("\n");
221
				(void)printf("\n");
222
223
				siginfo = 0;
210
			}
224
			}
211
		}
225
		}
212
	}
226
	}

Return to bug 191884