[BusyBox-cvs] busybox/networking ifupdown.c,1.14,1.15

Glenn McGrath bug1 at busybox.net
Sun Dec 8 01:23:42 UTC 2002


Update of /var/cvs/busybox/networking
In directory winder:/tmp/cvs-serv20729/networking

Modified Files:
	ifupdown.c 
Log Message:
Start to cleanup handling of the state file, save some space and uses linked lists.


Index: ifupdown.c
===================================================================
RCS file: /var/cvs/busybox/networking/ifupdown.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- ifupdown.c	7 Dec 2002 07:45:42 -0000	1.14
+++ ifupdown.c	8 Dec 2002 01:23:39 -0000	1.15
@@ -1,12 +1,14 @@
 /*
  *  ifupdown for busybox
- *  Based on ifupdown by Anthony Towns
+ *  Copyright (c) 2002 Glenn McGrath <bug1 at optushome.com.au>
+ *
+ *  Based on ifupdown v 0.6.4 by Anthony Towns
  *  Copyright (c) 1999 Anthony Towns <aj at azure.humbug.org.au>
  *
  *  Changes to upstream version
- *  Remove checks for kernel version, assume kernel version 2.2.0 or better
+ *  Remove checks for kernel version, assume kernel version 2.2.0 or better.
[...339 lines suppressed...]
-			rewind(state_fp);
-			for (j = 0; j < n_state; j++) {
-				fputs(state[i], state_fp);
+		rewind(state_fp);
+
+		while (state_list) {
+			if (state_list->data) {
+				fputs(state_list->data, state_fp);
 				fputc('\n', state_fp);
 			}
-			fflush(state_fp);
+			state_list = state_list->link;
 		}
+		fflush(state_fp);
 	}
 
+	/* Cleanup */
 	if (state_fp != NULL) {
 		fclose(state_fp);
 		state_fp = NULL;




More information about the busybox-cvs mailing list