FreeBSD Bugzilla – Attachment 144710 Details for
Bug 191884
[PATCH] teach chown and chmod about SIGINFO
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
chmod patch with updated makefile
chmod-siginfo.patch (text/plain), 1.69 KB, created by
Dan McGregor
on 2014-07-16 03:38:44 UTC
(
hide
)
Description:
chmod patch with updated makefile
Filename:
MIME Type:
Creator:
Dan McGregor
Created:
2014-07-16 03:38:44 UTC
Size:
1.69 KB
patch
obsolete
>Index: bin/chmod/chmod.1 >=================================================================== >--- bin/chmod/chmod.1 (révision 268715) >+++ bin/chmod/chmod.1 (copie de travail) >@@ -102,6 +102,16 @@ > In addition, these options override each other and the > command's actions are determined by the last one specified. > .Pp >+If >+.Nm >+receives a >+.Dv SIGINFO >+signal (see the >+.Cm status >+argument for >+.Xr stty 1 ) , >+then the current filename as well as the old and new modes are displayed. >+.Pp > Only the owner of a file or the super-user is permitted to change > the mode of a file. > .Sh EXIT STATUS >Index: bin/chmod/chmod.c >=================================================================== >--- bin/chmod/chmod.c (révision 268715) >+++ bin/chmod/chmod.c (copie de travail) >@@ -48,14 +48,24 @@ > #include <errno.h> > #include <fts.h> > #include <limits.h> >+#include <signal.h> > #include <stdio.h> > #include <stdlib.h> > #include <string.h> > #include <unistd.h> > >+static volatile sig_atomic_t siginfo; >+ > static void usage(void); > static int may_have_nfs4acl(const FTSENT *ent, int hflag); > >+static void >+siginfo_handler(int sig __unused) >+{ >+ >+ siginfo = 1; >+} >+ > int > main(int argc, char *argv[]) > { >@@ -125,6 +135,8 @@ > if (argc < 2) > usage(); > >+ (void)signal(SIGINFO, siginfo_handler); >+ > if (Rflag) { > fts_options = FTS_PHYSICAL; > if (hflag) >@@ -192,10 +204,10 @@ > rval = 1; > } > } else { >- if (vflag) { >+ if (vflag || siginfo) { > (void)printf("%s", p->fts_path); > >- if (vflag > 1) { >+ if (vflag > 1 || siginfo) { > char m1[12], m2[12]; > > strmode(p->fts_statp->st_mode, m1); >@@ -207,6 +219,8 @@ > newmode, m2); > } > (void)printf("\n"); >+ >+ siginfo = 0; > } > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 191884
:
144693
| 144710 |
144711