Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F170186253
D58442.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D58442.id.diff
View Options
diff --git a/usr.bin/rpcinfo/Makefile b/usr.bin/rpcinfo/Makefile
--- a/usr.bin/rpcinfo/Makefile
+++ b/usr.bin/rpcinfo/Makefile
@@ -4,6 +4,4 @@
CFLAGS+= -DPORTMAP
-WARNS?= 2
-
.include <bsd.prog.mk>
diff --git a/usr.bin/rpcinfo/rpcinfo.c b/usr.bin/rpcinfo/rpcinfo.c
--- a/usr.bin/rpcinfo/rpcinfo.c
+++ b/usr.bin/rpcinfo/rpcinfo.c
@@ -79,7 +79,7 @@
#define MAXHOSTLEN 256
#define MIN_VERS ((u_long) 0)
#define MAX_VERS ((u_long) 4294967295UL)
-#define UNKNOWN "unknown"
+static char unknown[] = "unknown";
/*
* Functions to be performed.
@@ -103,7 +103,7 @@
};
struct verslist {
- int vers;
+ rpcvers_t vers;
struct verslist *next;
};
@@ -145,8 +145,8 @@
static void usage(void);
static u_long getprognum(char *);
static u_long getvers(char *);
-static char *spaces(int);
-static bool_t add_version(struct rpcbdump_short *, u_long);
+static const char *spaces(size_t);
+static bool_t add_version(struct rpcbdump_short *, rpcvers_t);
static bool_t add_netid(struct rpcbdump_short *, char *);
int
@@ -597,13 +597,13 @@
struct sockaddr *sa = (struct sockaddr *)who->buf;
if (getnameinfo(sa, sa->sa_len, hostbuf, NI_MAXHOST, NULL, 0, 0)) {
- hostname = UNKNOWN;
+ hostname = unknown;
} else {
hostname = hostbuf;
}
uaddr = taddr2uaddr(nconf, who);
if (uaddr == NULL) {
- printf("%s\t%s\n", UNKNOWN, hostname);
+ printf("%s\t%s\n", unknown, hostname);
} else {
printf("%s\t%s\n", uaddr, hostname);
free((char *)uaddr);
@@ -630,7 +630,7 @@
}
static bool_t
-add_version(struct rpcbdump_short *rs, u_long vers)
+add_version(struct rpcbdump_short *rs, rpcvers_t vers)
{
struct verslist *vl;
@@ -769,7 +769,7 @@
}
if (list->rpcb_map.r_netid == NULL)
goto error;
- list->rpcb_map.r_owner = UNKNOWN;
+ list->rpcb_map.r_owner = unknown;
low = pmaphead->pml_map.pm_port & 0xff;
high = (pmaphead->pml_map.pm_port >> 8) & 0xff;
(void)asprintf(&list->rpcb_map.r_addr,
@@ -977,7 +977,8 @@
struct timeval minutetimeout;
register CLIENT *client;
char *host;
- int i, j;
+ unsigned int i;
+ int j;
rpcbs_addrlist *pa;
rpcbs_rmtcalllist *pr;
int cnt, flen;
@@ -1653,7 +1654,7 @@
}
static void
-print_getaddrstat(int rtype, rpcb_stat *infp)
+print_getaddrstat(int rtype __unused, rpcb_stat *infp)
{
rpcbs_addrlist_ptr al;
register struct rpcent *rpc;
@@ -1671,14 +1672,14 @@
}
}
-static char *
-spaces(int howmany)
+static const char *
+spaces(size_t howmany)
{
static char space_array[] = /* 64 spaces */
" ";
- if (howmany <= 0 || howmany > sizeof (space_array)) {
+ if (howmany >= sizeof(space_array)) {
return ("");
}
- return (&space_array[sizeof (space_array) - howmany - 1]);
+ return (&space_array[sizeof(space_array) - howmany - 1]);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Sep 4, 7:02 PM (20 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38225282
Default Alt Text
D58442.id.diff (2 KB)
Attached To
Mode
D58442: rpcinfo: Fix residual warnings and bump WARNS
Attached
Detach File
Event Timeline
Log In to Comment