aboutsummaryrefslogtreecommitdiff
path: root/networking/nameif.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-08-03 15:41:12 +0000
committerRob Landley <rob@landley.net>2006-08-03 15:41:12 +0000
commitd921b2ecc0d294ad4bf8c7458fc52a60c28727d2 (patch)
treee4a2769349867c441cf2983d83097bb66701a733 /networking/nameif.c
parent6dce0b6fa79f2d4bb7e9d90e1fbc0f6beb25f855 (diff)
downloadbusybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.gz
busybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.bz2
busybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.zip
Remove bb_ prefixes from xfuncs.c (and a few other places), consolidate
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only had one user), clean up lots of #includes... General cleanup pass. What I've been doing for the last couple days. And it conflicts! I've removed httpd.c from this checkin due to somebody else touching that file. It builds for me. I have to catch a bus. (Now you know why I'm looking forward to Mercurial.)
Diffstat (limited to 'networking/nameif.c')
-rw-r--r--networking/nameif.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/networking/nameif.c b/networking/nameif.c
index f13ef1b8b..501e244b1 100644
--- a/networking/nameif.c
+++ b/networking/nameif.c
@@ -10,13 +10,7 @@
10 */ 10 */
11 11
12#include "busybox.h" 12#include "busybox.h"
13 13#include <syslog.h>
14#include <sys/syslog.h>
15#include <sys/socket.h>
16#include <sys/ioctl.h>
17#include <errno.h>
18#include <string.h>
19#include <unistd.h>
20#include <net/if.h> 14#include <net/if.h>
21#include <netinet/ether.h> 15#include <netinet/ether.h>
22 16
@@ -107,7 +101,7 @@ int nameif_main(int argc, char **argv)
107 if (strlen(*a) > IF_NAMESIZE) 101 if (strlen(*a) > IF_NAMESIZE)
108 serror("interface name `%s' too long", *a); 102 serror("interface name `%s' too long", *a);
109 ch = xzalloc(sizeof(mactable_t)); 103 ch = xzalloc(sizeof(mactable_t));
110 ch->ifname = bb_xstrdup(*a++); 104 ch->ifname = xstrdup(*a++);
111 ch->mac = cc_macaddr(*a++); 105 ch->mac = cc_macaddr(*a++);
112 if (clist) 106 if (clist)
113 clist->prev = ch; 107 clist->prev = ch;
@@ -115,7 +109,7 @@ int nameif_main(int argc, char **argv)
115 clist = ch; 109 clist = ch;
116 } 110 }
117 } else { 111 } else {
118 ifh = bb_xfopen(fname, "r"); 112 ifh = xfopen(fname, "r");
119 113
120 while ((line = bb_get_line_from_file(ifh)) != NULL) { 114 while ((line = bb_get_line_from_file(ifh)) != NULL) {
121 char *line_ptr; 115 char *line_ptr;
@@ -128,7 +122,7 @@ int nameif_main(int argc, char **argv)
128 } 122 }
129 name_length = strcspn(line_ptr, " \t"); 123 name_length = strcspn(line_ptr, " \t");
130 ch = xzalloc(sizeof(mactable_t)); 124 ch = xzalloc(sizeof(mactable_t));
131 ch->ifname = bb_xstrndup(line_ptr, name_length); 125 ch->ifname = xstrndup(line_ptr, name_length);
132 if (name_length > IF_NAMESIZE) 126 if (name_length > IF_NAMESIZE)
133 serror("interface name `%s' too long", ch->ifname); 127 serror("interface name `%s' too long", ch->ifname);
134 line_ptr += name_length; 128 line_ptr += name_length;