svn commit: r260251 - head/usr.sbin/rpc.lockd

Xin LI delphij at FreeBSD.org
Sat Jan 4 01:12:29 UTC 2014


Author: delphij
Date: Sat Jan  4 01:12:28 2014
New Revision: 260251
URL: http://svnweb.freebsd.org/changeset/base/260251

Log:
  Make a copy instead using constant string directly when assigning to char *.
  
  While I'm there also remove a few prototypes that are unused.

Modified:
  head/usr.sbin/rpc.lockd/lockd.c

Modified: head/usr.sbin/rpc.lockd/lockd.c
==============================================================================
--- head/usr.sbin/rpc.lockd/lockd.c	Sat Jan  4 01:08:10 2014	(r260250)
+++ head/usr.sbin/rpc.lockd/lockd.c	Sat Jan  4 01:12:28 2014	(r260251)
@@ -101,10 +101,6 @@ static void	complete_service(struct netc
 static void	clearout_service(void);
 void 	lookup_addresses(struct netconfig *nconf);
 void	init_nsm(void);
-void	nlm_prog_0(struct svc_req *, SVCXPRT *);
-void	nlm_prog_1(struct svc_req *, SVCXPRT *);
-void	nlm_prog_3(struct svc_req *, SVCXPRT *);
-void	nlm_prog_4(struct svc_req *, SVCXPRT *);
 void	out_of_mem(void);
 void	usage(void);
 
@@ -228,7 +224,7 @@ main(int argc, char **argv)
 		if (hosts == NULL)
 			out_of_mem();
 
-		hosts[0] = "*";
+		hosts[0] = strdup("*");
 		nhosts = 1;
 	} else {
 		hosts_bak = hosts;
@@ -244,7 +240,7 @@ main(int argc, char **argv)
 				hosts = hosts_bak;
 
 			nhosts += 2;
-			hosts[nhosts - 2] = "::1";
+			hosts[nhosts - 2] = strdup("::1");
 		} else {
 			hosts_bak = realloc(hosts, (nhosts + 1) * sizeof(char *));
 			if (hosts_bak == NULL) {
@@ -258,7 +254,7 @@ main(int argc, char **argv)
 				hosts = hosts_bak;
 			}
 		}
-		hosts[nhosts - 1] = "127.0.0.1";
+		hosts[nhosts - 1] = strdup("127.0.0.1");
 	}
 
 	if (kernel_lockd) {


More information about the svn-src-all mailing list