diff options
author | Rob Landley <rob@landley.net> | 2006-08-03 15:41:12 +0000 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2006-08-03 15:41:12 +0000 |
commit | d921b2ecc0d294ad4bf8c7458fc52a60c28727d2 (patch) | |
tree | e4a2769349867c441cf2983d83097bb66701a733 /networking/traceroute.c | |
parent | 6dce0b6fa79f2d4bb7e9d90e1fbc0f6beb25f855 (diff) | |
download | busybox-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/traceroute.c')
-rw-r--r-- | networking/traceroute.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/networking/traceroute.c b/networking/traceroute.c index c2084fc1e..446490303 100644 --- a/networking/traceroute.c +++ b/networking/traceroute.c | |||
@@ -357,7 +357,7 @@ ifaddrlist(struct IFADDRLIST **ipaddrp) | |||
357 | struct ifreq ibuf[(32 * 1024) / sizeof(struct ifreq)], ifr; | 357 | struct ifreq ibuf[(32 * 1024) / sizeof(struct ifreq)], ifr; |
358 | struct IFADDRLIST *st_ifaddrlist; | 358 | struct IFADDRLIST *st_ifaddrlist; |
359 | 359 | ||
360 | fd = bb_xsocket(AF_INET, SOCK_DGRAM, 0); | 360 | fd = xsocket(AF_INET, SOCK_DGRAM, 0); |
361 | 361 | ||
362 | ifc.ifc_len = sizeof(ibuf); | 362 | ifc.ifc_len = sizeof(ibuf); |
363 | ifc.ifc_buf = (caddr_t)ibuf; | 363 | ifc.ifc_buf = (caddr_t)ibuf; |
@@ -457,7 +457,7 @@ findsaddr(const struct sockaddr_in *to, struct sockaddr_in *from) | |||
457 | struct IFADDRLIST *al; | 457 | struct IFADDRLIST *al; |
458 | char buf[256], tdevice[256], device[256]; | 458 | char buf[256], tdevice[256], device[256]; |
459 | 459 | ||
460 | f = bb_xfopen(route, "r"); | 460 | f = xfopen(route, "r"); |
461 | 461 | ||
462 | /* Find the appropriate interface */ | 462 | /* Find the appropriate interface */ |
463 | n = 0; | 463 | n = 0; |
@@ -875,7 +875,7 @@ gethostinfo(const char *host) | |||
875 | hi = xcalloc(1, sizeof(*hi)); | 875 | hi = xcalloc(1, sizeof(*hi)); |
876 | addr = inet_addr(host); | 876 | addr = inet_addr(host); |
877 | if ((int32_t)addr != -1) { | 877 | if ((int32_t)addr != -1) { |
878 | hi->name = bb_xstrdup(host); | 878 | hi->name = xstrdup(host); |
879 | hi->n = 1; | 879 | hi->n = 1; |
880 | hi->addrs = xcalloc(1, sizeof(hi->addrs[0])); | 880 | hi->addrs = xcalloc(1, sizeof(hi->addrs[0])); |
881 | hi->addrs[0] = addr; | 881 | hi->addrs[0] = addr; |
@@ -885,7 +885,7 @@ gethostinfo(const char *host) | |||
885 | hp = xgethostbyname(host); | 885 | hp = xgethostbyname(host); |
886 | if (hp->h_addrtype != AF_INET || hp->h_length != 4) | 886 | if (hp->h_addrtype != AF_INET || hp->h_length != 4) |
887 | bb_perror_msg_and_die("bad host %s", host); | 887 | bb_perror_msg_and_die("bad host %s", host); |
888 | hi->name = bb_xstrdup(hp->h_name); | 888 | hi->name = xstrdup(hp->h_name); |
889 | for (n = 0, p = hp->h_addr_list; *p != NULL; ++n, ++p) | 889 | for (n = 0, p = hp->h_addr_list; *p != NULL; ++n, ++p) |
890 | continue; | 890 | continue; |
891 | hi->n = n; | 891 | hi->n = n; |
@@ -1081,11 +1081,11 @@ traceroute_main(int argc, char *argv[]) | |||
1081 | bb_perror_msg_and_die("unknown protocol %s", cp); | 1081 | bb_perror_msg_and_die("unknown protocol %s", cp); |
1082 | 1082 | ||
1083 | /* Insure the socket fds won't be 0, 1 or 2 */ | 1083 | /* Insure the socket fds won't be 0, 1 or 2 */ |
1084 | do n = bb_xopen(bb_dev_null, O_RDONLY); while (n < 2); | 1084 | do n = xopen(bb_dev_null, O_RDONLY); while (n < 2); |
1085 | if (n > 2) | 1085 | if (n > 2) |
1086 | close(n); | 1086 | close(n); |
1087 | 1087 | ||
1088 | s = bb_xsocket(AF_INET, SOCK_RAW, pe->p_proto); | 1088 | s = xsocket(AF_INET, SOCK_RAW, pe->p_proto); |
1089 | 1089 | ||
1090 | #ifdef CONFIG_FEATURE_TRACEROUTE_SO_DEBUG | 1090 | #ifdef CONFIG_FEATURE_TRACEROUTE_SO_DEBUG |
1091 | if (op & USAGE_OP_DEBUG) | 1091 | if (op & USAGE_OP_DEBUG) |
@@ -1096,7 +1096,7 @@ traceroute_main(int argc, char *argv[]) | |||
1096 | (void)setsockopt(s, SOL_SOCKET, SO_DONTROUTE, (char *)&on, | 1096 | (void)setsockopt(s, SOL_SOCKET, SO_DONTROUTE, (char *)&on, |
1097 | sizeof(on)); | 1097 | sizeof(on)); |
1098 | 1098 | ||
1099 | sndsock = bb_xsocket(AF_INET, SOCK_RAW, IPPROTO_RAW); | 1099 | sndsock = xsocket(AF_INET, SOCK_RAW, IPPROTO_RAW); |
1100 | 1100 | ||
1101 | #ifdef CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE | 1101 | #ifdef CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE |
1102 | #if defined(IP_OPTIONS) | 1102 | #if defined(IP_OPTIONS) |
@@ -1248,7 +1248,7 @@ traceroute_main(int argc, char *argv[]) | |||
1248 | 1248 | ||
1249 | outip->ip_src = from->sin_addr; | 1249 | outip->ip_src = from->sin_addr; |
1250 | #ifndef IP_HDRINCL | 1250 | #ifndef IP_HDRINCL |
1251 | bb_xbind(sndsock, (struct sockaddr *)from, sizeof(*from)); | 1251 | xbind(sndsock, (struct sockaddr *)from, sizeof(*from)); |
1252 | #endif | 1252 | #endif |
1253 | 1253 | ||
1254 | fprintf(stderr, "traceroute to %s (%s)", hostname, inet_ntoa(to->sin_addr)); | 1254 | fprintf(stderr, "traceroute to %s (%s)", hostname, inet_ntoa(to->sin_addr)); |