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

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