Make extattrctl WARNS?=2-safe:

o remove extraneous extern's
o prototype functions
o combine multiple return (0)'s into a single return (0) at the
  end of main()

Approved by:	rwatson
Obtained from:	TrustedBSD Project
This commit is contained in:
Chris D. Faulhaber 2001-11-27 18:58:56 +00:00
parent dcd183a935
commit f2dd987c46
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=86994
2 changed files with 7 additions and 8 deletions

View File

@ -1,6 +1,7 @@
# $FreeBSD$ # $FreeBSD$
PROG= extattrctl PROG= extattrctl
WARNS?= 2
MAN= extattrctl.8 MAN= extattrctl.8
.include <bsd.prog.mk> .include <bsd.prog.mk>

View File

@ -48,11 +48,12 @@
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
extern char *optarg; int initattr(int argc, char *argv[]);
extern int optind; long num_inodes_by_path(char *path);
void usage(void);
void void
usage(void) usage()
{ {
fprintf(stderr, fprintf(stderr,
@ -176,7 +177,6 @@ main(int argc, char *argv[])
perror("extattrctl start"); perror("extattrctl start");
return (-1); return (-1);
} }
return (0);
} else if (!strcmp(argv[1], "stop")) { } else if (!strcmp(argv[1], "stop")) {
if (argc != 3) if (argc != 3)
usage(); usage();
@ -186,7 +186,6 @@ main(int argc, char *argv[])
perror("extattrctl stop"); perror("extattrctl stop");
return (-1); return (-1);
} }
return (0);
} else if (!strcmp(argv[1], "enable")) { } else if (!strcmp(argv[1], "enable")) {
if (argc != 6) if (argc != 6)
usage(); usage();
@ -201,7 +200,6 @@ main(int argc, char *argv[])
perror("extattrctl enable"); perror("extattrctl enable");
return (-1); return (-1);
} }
return (0);
} else if (!strcmp(argv[1], "disable")) { } else if (!strcmp(argv[1], "disable")) {
if (argc != 5) if (argc != 5)
usage(); usage();
@ -216,14 +214,14 @@ main(int argc, char *argv[])
perror("extattrctl disable"); perror("extattrctl disable");
return (-1); return (-1);
} }
return (0);
} else if (!strcmp(argv[1], "initattr")) { } else if (!strcmp(argv[1], "initattr")) {
argc -= 2; argc -= 2;
argv += 2; argv += 2;
error = initattr(argc, argv); error = initattr(argc, argv);
if (error) if (error)
return (-1); return (-1);
return (0);
} else } else
usage(); usage();
return (0);
} }