diff options
author | ed <ed@FreeBSD.org> | 2011-11-06 19:01:41 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2011-11-06 19:01:41 +0000 |
commit | 57acbc3db8c0e89d8ccd4d31cca3b8e6522fabc6 (patch) | |
tree | 4cecc2dfb7fe9dee3e035aa6f8beca6341531dca /usr.sbin | |
parent | b99d6c2ed3dc383ae665b822fa97016aff636e94 (diff) | |
download | FreeBSD-src-57acbc3db8c0e89d8ccd4d31cca3b8e6522fabc6.zip FreeBSD-src-57acbc3db8c0e89d8ccd4d31cca3b8e6522fabc6.tar.gz |
Mark global functions and/or variables in chown(8) static where possible.
This allows compilers and static analyzers to do more thorough analysis.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/chown/chown.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/usr.sbin/chown/chown.c b/usr.sbin/chown/chown.c index e13235c..9780f02 100644 --- a/usr.sbin/chown/chown.c +++ b/usr.sbin/chown/chown.c @@ -57,16 +57,16 @@ __FBSDID("$FreeBSD$"); #include <string.h> #include <unistd.h> -void a_gid(const char *); -void a_uid(const char *); -void chownerr(const char *); -uid_t id(const char *, const char *); -void usage(void); +static void a_gid(const char *); +static void a_uid(const char *); +static void chownerr(const char *); +static uid_t id(const char *, const char *); +static void usage(void); -uid_t uid; -gid_t gid; -int ischown; -const char *gname; +static uid_t uid; +static gid_t gid; +static int ischown; +static const char *gname; int main(int argc, char **argv) @@ -229,7 +229,7 @@ main(int argc, char **argv) exit(rval); } -void +static void a_gid(const char *s) { struct group *gr; @@ -240,7 +240,7 @@ a_gid(const char *s) gid = ((gr = getgrnam(s)) != NULL) ? gr->gr_gid : id(s, "group"); } -void +static void a_uid(const char *s) { struct passwd *pw; @@ -250,7 +250,7 @@ a_uid(const char *s) uid = ((pw = getpwnam(s)) != NULL) ? pw->pw_uid : id(s, "user"); } -uid_t +static uid_t id(const char *name, const char *type) { uid_t val; @@ -267,7 +267,7 @@ id(const char *name, const char *type) return (val); } -void +static void chownerr(const char *file) { static uid_t euid = -1; @@ -299,7 +299,7 @@ chownerr(const char *file) warn("%s", file); } -void +static void usage(void) { |