[BusyBox-cvs] CVS busybox/networking

CVS User bug1 bug1 at codepoet.org
Tue Sep 14 17:24:58 UTC 2004


Update of /var/cvs/busybox/networking
In directory nail:/tmp/cvs-serv24804/networking

Modified Files:
	ifupdown.c telnet.c telnetd.c tftp.c 
Log Message:
Patch from Felipe Kellermann, remove some unnecessary dups, i declared a few extra const's also.


--- /var/cvs/busybox/networking/ifupdown.c	2004/07/30 14:45:08	1.50
+++ /var/cvs/busybox/networking/ifupdown.c	2004/09/14 17:24:58	1.51
@@ -699,7 +699,7 @@
 	return(NULL);
 }
 
-static struct interfaces_file_t *read_interfaces(char *filename)
+static struct interfaces_file_t *read_interfaces(const char *filename)
 {
 #ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
 	struct mapping_defn_t *currmap = NULL;
@@ -1192,7 +1192,7 @@
 	FILE *state_fp = NULL;
 	llist_t *state_list = NULL;
 	llist_t *target_list = NULL;
-	char *interfaces = "/etc/network/interfaces";
+	const char *interfaces = "/etc/network/interfaces";
 	const char *statefile = "/var/run/ifstate";
 
 #ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
@@ -1219,7 +1219,7 @@
 		{
 			switch (i) {
 				case 'i':	/* interfaces */
-					interfaces = bb_xstrdup(optarg);
+					interfaces = optarg;
 					break;
 				case 'v':	/* verbose */
 					verbose = 1;
--- /var/cvs/busybox/networking/telnet.c	2004/03/15 08:28:50	1.43
+++ /var/cvs/busybox/networking/telnet.c	2004/09/14 17:24:58	1.44
@@ -132,7 +132,7 @@
 #endif
 
 #ifdef CONFIG_FEATURE_TELNET_AUTOLOGIN
-static char *autologin;
+static const char *autologin;
 #endif
 
 #ifdef CONFIG_FEATURE_AUTOWIDTH
@@ -663,7 +663,7 @@
 	while ((opt = getopt(argc, argv, "al:")) != EOF) {
 		switch (opt) {
 			case 'l':
-				autologin = bb_xstrdup(optarg);
+				autologin = optarg;
 				break;
 			case 'a':
 				autologin = getenv("USER");
--- /var/cvs/busybox/networking/telnetd.c	2004/06/22 10:07:17	1.12
+++ /var/cvs/busybox/networking/telnetd.c	2004/09/14 17:24:58	1.13
@@ -1,4 +1,4 @@
-/* $Id: telnetd.c,v 1.12 2004/06/22 10:07:17 andersen Exp $
+/* $Id: telnetd.c,v 1.13 2004/09/14 17:24:58 bug1 Exp $
  *
  * Simple telnet server
  * Bjorn Wesen, Axis Communications AB (bjornw at axis.com)
@@ -49,11 +49,10 @@
 
 #define BUFSIZE 4000
 
-static const char *loginpath
 #ifdef CONFIG_LOGIN
- = "/bin/login";
+static const char *loginpath = "/bin/login";
 #else
-;
+static const char *loginpath;
 #endif
 static const char *issuefile = "/etc/issue.net";
 
@@ -401,10 +400,10 @@
 		if (c == EOF) break;
 		switch (c) {
 			case 'f':
-				issuefile = strdup (optarg);
+				issuefile = optarg;
 				break;
 			case 'l':
-				loginpath = strdup (optarg);
+				loginpath = optarg;
 				break;
 #ifndef CONFIG_FEATURE_TELNETD_INETD
 			case 'p':
--- /var/cvs/busybox/networking/tftp.c	2004/06/22 10:18:30	1.28
+++ /var/cvs/busybox/networking/tftp.c	2004/09/14 17:24:58	1.29
@@ -485,8 +485,8 @@
 int tftp_main(int argc, char **argv)
 {
 	struct hostent *host = NULL;
-	char *localfile = NULL;
-	char *remotefile = NULL;
+	const char *localfile = NULL;
+	const char *remotefile = NULL;
 	int port;
 	int cmd = 0;
 	int fd = -1;
@@ -538,10 +538,10 @@
 			break;
 #endif
 		case 'l':
-			localfile = bb_xstrdup(optarg);
+			localfile = optarg;
 			break;
 		case 'r':
-			remotefile = bb_xstrdup(optarg);
+			remotefile = optarg;
 			break;
 		}
 	}



More information about the busybox-cvs mailing list