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-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.gz
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 @@
*/
#include "busybox.h"
-
-#include <sys/syslog.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <errno.h>
-#include <string.h>
-#include <unistd.h>
+#include <syslog.h>
#include <net/if.h>
#include <netinet/ether.h>
@@ -107,7 +101,7 @@ int nameif_main(int argc, char **argv)
if (strlen(*a) > IF_NAMESIZE)
serror("interface name `%s' too long", *a);
ch = xzalloc(sizeof(mactable_t));
- ch->ifname = bb_xstrdup(*a++);
+ ch->ifname = xstrdup(*a++);
ch->mac = cc_macaddr(*a++);
if (clist)
clist->prev = ch;
@@ -115,7 +109,7 @@ int nameif_main(int argc, char **argv)
clist = ch;
}
} else {
- ifh = bb_xfopen(fname, "r");
+ ifh = xfopen(fname, "r");
while ((line = bb_get_line_from_file(ifh)) != NULL) {
char *line_ptr;
@@ -128,7 +122,7 @@ int nameif_main(int argc, char **argv)
}
name_length = strcspn(line_ptr, " \t");
ch = xzalloc(sizeof(mactable_t));
- ch->ifname = bb_xstrndup(line_ptr, name_length);
+ ch->ifname = xstrndup(line_ptr, name_length);
if (name_length > IF_NAMESIZE)
serror("interface name `%s' too long", ch->ifname);
line_ptr += name_length;