summaryrefslogtreecommitdiffstats
path: root/usr.bin/xinstall
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2009-12-14 16:54:39 +0000
committerdelphij <delphij@FreeBSD.org>2009-12-14 16:54:39 +0000
commitf86f4aa6c808bb49f5e5252a6054b0bd87088288 (patch)
tree96a4a99ed31d75bf9d4d942f90c47d3b96714e44 /usr.bin/xinstall
parentfa075a4c4b06374b43e932e641dc290801bb1732 (diff)
downloadFreeBSD-src-f86f4aa6c808bb49f5e5252a6054b0bd87088288.zip
FreeBSD-src-f86f4aa6c808bb49f5e5252a6054b0bd87088288.tar.gz
Style improvements:
- Sort function prototypes; - Apply static on all function bodies. To quote bde@: > It is a good obfuscation to declare functions as static only in the > prototype, so that you can't see the static for the actual function. > The reverse obfuscation (with static only in the function definition) > would make more sense, but is a constraint error. Reviewed by: bde
Diffstat (limited to 'usr.bin/xinstall')
-rw-r--r--usr.bin/xinstall/xinstall.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c
index f896d6c..1466645 100644
--- a/usr.bin/xinstall/xinstall.c
+++ b/usr.bin/xinstall/xinstall.c
@@ -85,8 +85,8 @@ int dobackup, docompare, dodir, dopreserve, dostrip, nommap, safecopy, verbose;
mode_t mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
const char *suffix = BACKUP_SUFFIX;
-static void copy(int, const char *, int, const char *, off_t);
static int compare(int, const char *, size_t, int, const char *, size_t);
+static void copy(int, const char *, int, const char *, off_t);
static int create_newfile(const char *, int, struct stat *);
static int create_tempfile(const char *, char *, size_t);
static void install(const char *, const char *, u_long, u_int);
@@ -246,7 +246,7 @@ main(int argc, char *argv[])
/* NOTREACHED */
}
-u_long
+static u_long
numeric_id(const char *name, const char *type)
{
u_long val;
@@ -269,7 +269,7 @@ numeric_id(const char *name, const char *type)
* install --
* build a path name and install the file
*/
-void
+static void
install(const char *from_name, const char *to_name, u_long fset, u_int flags)
{
struct stat from_sb, temp_sb, to_sb;
@@ -523,7 +523,7 @@ install(const char *from_name, const char *to_name, u_long fset, u_int flags)
* compare --
* compare two files; non-zero means files differ
*/
-int
+static int
compare(int from_fd, const char *from_name __unused, size_t from_len,
int to_fd, const char *to_name __unused, size_t to_len)
{
@@ -587,7 +587,7 @@ compare(int from_fd, const char *from_name __unused, size_t from_len,
* create_tempfile --
* create a temporary file based on path and open it
*/
-int
+static int
create_tempfile(const char *path, char *temp, size_t tsize)
{
char *p;
@@ -607,7 +607,7 @@ create_tempfile(const char *path, char *temp, size_t tsize)
* create_newfile --
* create a new file, overwriting an existing one if necessary
*/
-int
+static int
create_newfile(const char *path, int target, struct stat *sbp)
{
char backup[MAXPATHLEN];
@@ -650,7 +650,7 @@ create_newfile(const char *path, int target, struct stat *sbp)
* copy --
* copy from one file to another
*/
-void
+static void
copy(int from_fd, const char *from_name, int to_fd, const char *to_name,
off_t size)
{
@@ -703,7 +703,7 @@ copy(int from_fd, const char *from_name, int to_fd, const char *to_name,
* strip --
* use strip(1) to strip the target file
*/
-void
+static void
strip(const char *to_name)
{
const char *stripbin;
@@ -735,7 +735,7 @@ strip(const char *to_name)
* install_dir --
* build directory heirarchy
*/
-void
+static void
install_dir(char *path)
{
char *p;
@@ -769,7 +769,7 @@ install_dir(char *path)
* usage --
* print a usage message and die
*/
-void
+static void
usage(void)
{
(void)fprintf(stderr,
@@ -786,7 +786,7 @@ usage(void)
* trymmap --
* return true (1) if mmap should be tried, false (0) if not.
*/
-int
+static int
trymmap(int fd)
{
/*
OpenPOWER on IntegriCloud