Blame SOURCES/autofs-5.1.3-remove-some-redundant-rpc-library-code.patch

304803
autofs-5.1.3 - remove some redundant rpc library code
304803
304803
From: Ian Kent <raven@themaw.net>
304803
304803
Remove some redundant code that was used long long ago for testing.
304803
304803
Signed-off-by: Ian Kent <raven@themaw.net>
304803
---
304803
 CHANGELOG          |    1 
304803
 include/rpc_subs.h |    1 
304803
 lib/rpc_subs.c     |   87 -----------------------------------------------------
304803
 3 files changed, 1 insertion(+), 88 deletions(-)
304803
304803
--- autofs-5.0.7.orig/CHANGELOG
304803
+++ autofs-5.0.7/CHANGELOG
304803
@@ -303,6 +303,7 @@
304803
 - use systemd sd_notify() at startup.
304803
 - fix update_negative_cache() map source usage.
304803
 - mark removed cache entry negative.
304803
+- remove some redundant rpc library code.
304803
 
304803
 25/07/2012 autofs-5.0.7
304803
 =======================
304803
--- autofs-5.0.7.orig/include/rpc_subs.h
304803
+++ autofs-5.0.7/include/rpc_subs.h
304803
@@ -71,7 +71,6 @@ int rpc_portmap_getport(struct conn_info
304803
 int rpc_ping_proto(struct conn_info *);
304803
 int rpc_ping(const char *, long, long, unsigned int);
304803
 double elapsed(struct timeval, struct timeval);
304803
-int rpc_time(const char *, unsigned int, unsigned int, long, long, unsigned int, double *);
304803
 const char *get_addr_string(struct sockaddr *, char *, socklen_t);
304803
 
304803
 #endif
304803
--- autofs-5.0.7.orig/lib/rpc_subs.c
304803
+++ autofs-5.0.7/lib/rpc_subs.c
304803
@@ -1090,32 +1090,6 @@ double elapsed(struct timeval start, str
304803
 	return t2-t1;
304803
 }
304803
 
304803
-int rpc_time(const char *host,
304803
-	     unsigned int ping_vers, unsigned int ping_proto,
304803
-	     long seconds, long micros, unsigned int option, double *result)
304803
-{
304803
-	int status;
304803
-	double taken;
304803
-	struct timeval start, end;
304803
-	struct timezone tz;
304803
-	int proto = (ping_proto & RPC_PING_UDP) ? IPPROTO_UDP : IPPROTO_TCP;
304803
-	unsigned long vers = ping_vers;
304803
-
304803
-	gettimeofday(&start, &tz;;
304803
-	status = __rpc_ping(host, vers, proto, seconds, micros, option);
304803
-	gettimeofday(&end, &tz;;
304803
-
304803
-	if (status == RPC_PING_FAIL || status < 0)
304803
-		return status;
304803
-
304803
-	taken = elapsed(start, end);
304803
-
304803
-	if (result != NULL)
304803
-		*result = taken;
304803
-
304803
-	return status;
304803
-}
304803
-
304803
 static int rpc_get_exports_proto(struct conn_info *info, exports *exp)
304803
 {
304803
 	CLIENT *client;
304803
@@ -1288,64 +1262,3 @@ const char *get_addr_string(struct socka
304803
 
304803
 	return inet_ntop(sa->sa_family, addr, name, len);
304803
 }
304803
-
304803
-#if 0
304803
-#include <stdio.h>
304803
-
304803
-int main(int argc, char **argv)
304803
-{
304803
-	int ret;
304803
-	double res = 0.0;
304803
-	exports exportlist, tmp;
304803
-	groups grouplist;
304803
-	int n, maxlen;
304803
-
304803
-/*
304803
-	ret = rpc_ping("budgie", 10, 0, RPC_CLOSE_DEFAULT);
304803
-	printf("ret = %d\n", ret);
304803
-
304803
-	res = 0.0;
304803
-	ret = rpc_time("budgie", NFS2_VERSION, RPC_PING_TCP, 10, 0, RPC_CLOSE_DEFAULT, &res;;
304803
-	printf("v2 tcp ret = %d, res = %f\n", ret, res);
304803
-
304803
-	res = 0.0;
304803
-	ret = rpc_time("budgie", NFS3_VERSION, RPC_PING_TCP, 10, 0, RPC_CLOSE_DEFAULT, &res;;
304803
-	printf("v3 tcp ret = %d, res = %f\n", ret, res);
304803
-
304803
-	res = 0.0;
304803
-	ret = rpc_time("budgie", NFS2_VERSION, RPC_PING_UDP, 10, 0, RPC_CLOSE_DEFAULT, &res;;
304803
-	printf("v2 udp ret = %d, res = %f\n", ret, res);
304803
-
304803
-	res = 0.0;
304803
-	ret = rpc_time("budgie", NFS3_VERSION, RPC_PING_UDP, 10, 0, RPC_CLOSE_DEFAULT, &res;;
304803
-	printf("v3 udp ret = %d, res = %f\n", ret, res);
304803
-*/
304803
-	exportlist = rpc_get_exports("budgie", 10, 0, RPC_CLOSE_NOLINGER);
304803
-	exportlist = rpc_exports_prune(exportlist);
304803
-
304803
-	maxlen = 0;
304803
-	for (tmp = exportlist; tmp; tmp = tmp->ex_next) {
304803
-		if ((n = strlen(tmp->ex_dir)) > maxlen)
304803
-			maxlen = n;
304803
-	}
304803
-
304803
-	if (exportlist) {
304803
-		while (exportlist) {
304803
-			printf("%-*s ", maxlen, exportlist->ex_dir);
304803
-			grouplist = exportlist->ex_groups;
304803
-			if (grouplist) {
304803
-				while (grouplist) {
304803
-					printf("%s%s", grouplist->gr_name,
304803
-						grouplist->gr_next ? "," : "");
304803
-					grouplist = grouplist->gr_next;
304803
-				}
304803
-			}
304803
-			printf("\n");
304803
-			exportlist = exportlist->ex_next;
304803
-		}
304803
-	}
304803
-	rpc_exports_free(exportlist);
304803
-
304803
-	exit(0);
304803
-}
304803
-#endif