diff options
author | pjd <pjd@FreeBSD.org> | 2013-03-21 22:44:33 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2013-03-21 22:44:33 +0000 |
commit | 2a3cf7f364f936c42d03f20e3517e2213372b6bd (patch) | |
tree | 1c36abb6f394391f7fb768b78ab2d383820e11cb /bin | |
parent | c966fdfb31aaad19afdaeaa7727b7f658662f433 (diff) | |
download | FreeBSD-src-2a3cf7f364f936c42d03f20e3517e2213372b6bd.zip FreeBSD-src-2a3cf7f364f936c42d03f20e3517e2213372b6bd.tar.gz |
- Make 'flags' argument to chflags(2), fchflags(2) and lchflags(2) of type
u_long. Before this change it was of type int for syscalls, but prototypes
in sys/stat.h and documentation for chflags(2) and fchflags(2) (but not
for lchflags(2)) stated that it was u_long. Now some related functions
use u_long type for flags (strtofflags(3), fflagstostr(3)).
- Make path argument of type 'const char *' for consistency.
Discussed on: arch
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'bin')
-rw-r--r-- | bin/chflags/chflags.c | 6 | ||||
-rw-r--r-- | bin/mv/mv.c | 2 |
2 files changed, 2 insertions, 6 deletions
diff --git a/bin/chflags/chflags.c b/bin/chflags/chflags.c index 2c07db9..e94c34d 100644 --- a/bin/chflags/chflags.c +++ b/bin/chflags/chflags.c @@ -117,11 +117,7 @@ main(int argc, char *argv[]) } else fts_options = hflag ? FTS_PHYSICAL : FTS_LOGICAL; - /* XXX: Why don't chflags and lchflags have compatible prototypes? */ - if (hflag) - change_flags = (int (*)(const char *, unsigned long))lchflags; - else - change_flags = chflags; + change_flags = hflag ? lchflags : chflags; flags = *argv; if (*flags >= '0' && *flags <= '7') { diff --git a/bin/mv/mv.c b/bin/mv/mv.c index 5147a2db..2710f89 100644 --- a/bin/mv/mv.c +++ b/bin/mv/mv.c @@ -337,7 +337,7 @@ err: if (unlink(to)) * on a file that we copied, i.e., that we didn't create.) */ errno = 0; - if (fchflags(to_fd, (u_long)sbp->st_flags)) + if (fchflags(to_fd, sbp->st_flags)) if (errno != EOPNOTSUPP || sbp->st_flags != 0) warn("%s: set flags (was: 0%07o)", to, sbp->st_flags); |