#define MAXHOSTLEN 256
-int dump_cmp(p, q)
-char **p;
-char **q;
+static int dump_cmp(const void *pv, const void *qv)
{
+ const char **p = (const char **)pv;
+ const char **q = (const char **)qv;
return strcmp(*p, *q);
}
-static void usage(fp, n)
-FILE *fp;
-int n;
+static void usage(FILE *fp, int n)
{
fprintf(fp, "Usage: %s [-adehv]\n", program_name);
fprintf(fp, " [--all] [--directories] [--exports]\n");
FD_ZERO(&rset);
FD_SET(fd, &rset);
- ret = select(fd + 1, &rset, NULL, NULL, tout);
+ ret = select(fd + 1, NULL, &rset, NULL, tout);
if (ret <= 0) {
if (ret == 0)
ret = -ETIMEDOUT;
rpc_createerr.cf_error.re_errno = errno;
return 0;
}
+ client = clnttcp_create(&saddr,
+ PMAPPROG, PMAPVERS, &sock,
+ 0, 0);
} else {
/*
* bind to any unused port. If we left this up to the rpc
sock = RPC_ANYSOCK;
/* FALLTHROUGH */
}
+ client = clntudp_bufcreate(&saddr, PMAPPROG, PMAPVERS,
+ tout, &sock, send_sz, recv_sz);
}
- client = clntudp_bufcreate(&saddr, PMAPPROG, PMAPVERS,
- tout, &sock, send_sz, recv_sz);
if (!client) {
close(sock);
rpc_createerr.cf_stat = RPC_RPCBFAILURE;
return htons(port);
}
-int main(argc, argv)
-int argc;
-char **argv;
+int main(int argc, char **argv)
{
char hostname_buf[MAXHOSTLEN];
char *hostname;