mirror of
https://git.FreeBSD.org/src.git
synced 2024-11-23 07:31:31 +00:00
ANSIfy some more tools in usr.sbin/.
Most of these tools build with WARNS=6, except for their use of K&R function declarations.
This commit is contained in:
parent
b7946da96b
commit
9a958de54c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=201387
@ -80,7 +80,7 @@ main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
usage()
|
usage(void)
|
||||||
{
|
{
|
||||||
(void)fprintf(stderr, "usage: accton [file]\n");
|
(void)fprintf(stderr, "usage: accton [file]\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -1327,8 +1327,8 @@ an_setkeys(const char *iface, const char *key, int keytype)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void an_readkeyinfo(iface)
|
static void
|
||||||
const char *iface;
|
an_readkeyinfo(const char *iface)
|
||||||
{
|
{
|
||||||
struct an_req areq;
|
struct an_req areq;
|
||||||
struct an_ltv_genconfig *cfg;
|
struct an_ltv_genconfig *cfg;
|
||||||
|
@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
* Works with a live kernel only.
|
* Works with a live kernel only.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
asf_kld()
|
asf_kld(void)
|
||||||
{
|
{
|
||||||
struct kld_file_stat kfs;
|
struct kld_file_stat kfs;
|
||||||
int fid = 0; /* indicates the beginning of the linker file list */
|
int fid = 0; /* indicates the beginning of the linker file list */
|
||||||
|
@ -61,9 +61,7 @@ char *group; /* group to switch to ... */
|
|||||||
char *grouplist; /* group list to switch to ... */
|
char *grouplist; /* group list to switch to ... */
|
||||||
|
|
||||||
int
|
int
|
||||||
main(argc, argv)
|
main(int argc, char *argv[])
|
||||||
int argc;
|
|
||||||
char *argv[];
|
|
||||||
{
|
{
|
||||||
struct group *gp;
|
struct group *gp;
|
||||||
struct passwd *pw;
|
struct passwd *pw;
|
||||||
@ -179,7 +177,7 @@ main(argc, argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
usage()
|
usage(void)
|
||||||
{
|
{
|
||||||
(void)fprintf(stderr, "usage: chroot [-g group] [-G group,group,...] "
|
(void)fprintf(stderr, "usage: chroot [-g group] [-G group,group,...] "
|
||||||
"[-u user] newroot [command]\n");
|
"[-u user] newroot [command]\n");
|
||||||
|
@ -54,7 +54,7 @@ long num_inodes_by_path(char *path);
|
|||||||
void usage(void);
|
void usage(void);
|
||||||
|
|
||||||
void
|
void
|
||||||
usage()
|
usage(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
|
@ -791,7 +791,7 @@ exit_success(const char *fmt, ...)
|
|||||||
|
|
||||||
#ifdef USE_ROUTE
|
#ifdef USE_ROUTE
|
||||||
static void
|
static void
|
||||||
grab_myaddrs()
|
grab_myaddrs(void)
|
||||||
{
|
{
|
||||||
struct ifaddrs *ifap, *ifa;
|
struct ifaddrs *ifap, *ifa;
|
||||||
struct myaddrs *p;
|
struct myaddrs *p;
|
||||||
@ -847,7 +847,7 @@ grab_myaddrs()
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
free_myaddrs()
|
free_myaddrs(void)
|
||||||
{
|
{
|
||||||
struct myaddrs *p, *q;
|
struct myaddrs *p, *q;
|
||||||
|
|
||||||
@ -861,7 +861,7 @@ free_myaddrs()
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
update_myaddrs()
|
update_myaddrs(void)
|
||||||
{
|
{
|
||||||
char msg[BUFSIZ];
|
char msg[BUFSIZ];
|
||||||
int len;
|
int len;
|
||||||
@ -900,7 +900,7 @@ update_myaddrs()
|
|||||||
#endif /*USE_ROUTE*/
|
#endif /*USE_ROUTE*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
usage()
|
usage(void)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "usage: %s [-dp] [-f conf] service [serverpath [serverargs]]\n",
|
fprintf(stderr, "usage: %s [-dp] [-f conf] service [serverpath [serverargs]]\n",
|
||||||
faithdname);
|
faithdname);
|
||||||
|
@ -1397,8 +1397,7 @@ setsockopt(fd, SOL_SOCKET, opt, (char *)&on, sizeof (on))
|
|||||||
|
|
||||||
#ifdef IPSEC
|
#ifdef IPSEC
|
||||||
void
|
void
|
||||||
ipsecsetup(sep)
|
ipsecsetup(struct servtab *sep)
|
||||||
struct servtab *sep;
|
|
||||||
{
|
{
|
||||||
char *buf;
|
char *buf;
|
||||||
char *policy_in = NULL;
|
char *policy_in = NULL;
|
||||||
|
@ -1148,7 +1148,7 @@ mux_keyboard(u_int op, char *kbd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
usage()
|
usage(void)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s\n%s\n%s\n",
|
fprintf(stderr, "%s\n%s\n%s\n",
|
||||||
"usage: kbdcontrol [-dFKix] [-A name] [-a name] [-b duration.pitch | [quiet.]belltype]",
|
"usage: kbdcontrol [-dFKix] [-A name] [-a name] [-b duration.pitch | [quiet.]belltype]",
|
||||||
|
@ -272,7 +272,7 @@ main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
usage()
|
usage(void)
|
||||||
{
|
{
|
||||||
(void)fprintf(stderr,
|
(void)fprintf(stderr,
|
||||||
"usage: mount_portalfs [-o options] config mount-point\n");
|
"usage: mount_portalfs [-o options] config mount-point\n");
|
||||||
|
@ -91,10 +91,8 @@ extern const char *__progname;
|
|||||||
nt_hdr = (image_nt_header *)(x + dos_hdr->idh_lfanew); \
|
nt_hdr = (image_nt_header *)(x + dos_hdr->idh_lfanew); \
|
||||||
sect_hdr = IMAGE_FIRST_SECTION(nt_hdr);
|
sect_hdr = IMAGE_FIRST_SECTION(nt_hdr);
|
||||||
|
|
||||||
static
|
static int
|
||||||
int insert_padding(imgbase, imglen)
|
insert_padding(void **imgbase, int *imglen)
|
||||||
void **imgbase;
|
|
||||||
int *imglen;
|
|
||||||
{
|
{
|
||||||
image_section_header *sect_hdr;
|
image_section_header *sect_hdr;
|
||||||
image_dos_header *dos_hdr;
|
image_dos_header *dos_hdr;
|
||||||
|
@ -154,10 +154,7 @@ usage(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
quotaonoff(fs, offmode, type, qfpathname)
|
quotaonoff(struct fstab *fs, int offmode, int type, char *qfpathname)
|
||||||
register struct fstab *fs;
|
|
||||||
int offmode, type;
|
|
||||||
char *qfpathname;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
if (strcmp(fs->fs_file, "/") && readonly(fs))
|
if (strcmp(fs->fs_file, "/") && readonly(fs))
|
||||||
|
@ -68,9 +68,7 @@ static const char *sa_n2a(struct sockaddr *);
|
|||||||
static const char *inet6_n2a(struct in6_addr *);
|
static const char *inet6_n2a(struct in6_addr *);
|
||||||
|
|
||||||
int
|
int
|
||||||
main(argc, argv)
|
main(int argc, char *argv[])
|
||||||
int argc;
|
|
||||||
char **argv;
|
|
||||||
{
|
{
|
||||||
struct netinfo6 *np;
|
struct netinfo6 *np;
|
||||||
struct sockaddr_in6 fsock;
|
struct sockaddr_in6 fsock;
|
||||||
@ -175,15 +173,14 @@ main(argc, argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
usage()
|
usage(void)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "usage: rip6query [-I iface] address\n");
|
fprintf(stderr, "usage: rip6query [-I iface] address\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* getnameinfo() is preferred as we may be able to show ifindex as ifname */
|
/* getnameinfo() is preferred as we may be able to show ifindex as ifname */
|
||||||
static const char *
|
static const char *
|
||||||
sa_n2a(sa)
|
sa_n2a(struct sockaddr *sa)
|
||||||
struct sockaddr *sa;
|
|
||||||
{
|
{
|
||||||
static char buf[NI_MAXHOST];
|
static char buf[NI_MAXHOST];
|
||||||
|
|
||||||
@ -195,8 +192,7 @@ sa_n2a(sa)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
inet6_n2a(addr)
|
inet6_n2a(struct in6_addr *addr)
|
||||||
struct in6_addr *addr;
|
|
||||||
{
|
{
|
||||||
static char buf[NI_MAXHOST];
|
static char buf[NI_MAXHOST];
|
||||||
|
|
||||||
|
@ -206,8 +206,7 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
getstring(bp)
|
getstring(char *bp)
|
||||||
char *bp;
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char *cp = bp;
|
char *cp = bp;
|
||||||
@ -222,9 +221,7 @@ getstring(bp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
checkbuf(rec, size)
|
checkbuf(char *rec, int size)
|
||||||
char *rec;
|
|
||||||
int size;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
if (size <= maxrecsize)
|
if (size <= maxrecsize)
|
||||||
@ -244,8 +241,7 @@ checkbuf(rec, size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
error(num)
|
error(int num)
|
||||||
int num;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
DEBUG2("rmtd: E %d (%s)\n", num, strerror(num));
|
DEBUG2("rmtd: E %d (%s)\n", num, strerror(num));
|
||||||
|
Loading…
Reference in New Issue
Block a user