aboutsummaryrefslogtreecommitdiff
path: root/networking/libiproute
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-01-29 23:43:18 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-01-29 23:43:18 +0000
commit89ef65f02463b27313ff0eba806aa6e4aec10716 (patch)
tree70eab3e72843b1418ef3d88437c1f1a19169bda8 /networking/libiproute
parentab2aea44479fd6f519bccd651a37f30e792b7593 (diff)
downloadbusybox-w32-89ef65f02463b27313ff0eba806aa6e4aec10716.tar.gz
busybox-w32-89ef65f02463b27313ff0eba806aa6e4aec10716.tar.bz2
busybox-w32-89ef65f02463b27313ff0eba806aa6e4aec10716.zip
preparatory patch for -Wwrite-strings #5
Diffstat (limited to 'networking/libiproute')
-rw-r--r--networking/libiproute/ip_common.h3
-rw-r--r--networking/libiproute/ip_parse_common_args.c2
-rw-r--r--networking/libiproute/iplink.c2
-rw-r--r--networking/libiproute/iproute.c16
-rw-r--r--networking/libiproute/utils.h3
5 files changed, 11 insertions, 15 deletions
diff --git a/networking/libiproute/ip_common.h b/networking/libiproute/ip_common.h
index 15291780e..05a6a95f5 100644
--- a/networking/libiproute/ip_common.h
+++ b/networking/libiproute/ip_common.h
@@ -14,7 +14,8 @@
14#endif 14#endif
15 15
16extern int preferred_family; 16extern int preferred_family;
17extern char * _SL_; 17//FIXME! Appears in two .h files!
18extern const char * _SL_;
18 19
19extern void ip_parse_common_args(int *argcp, char ***argvp); 20extern void ip_parse_common_args(int *argcp, char ***argvp);
20extern int print_neigh(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg); 21extern int print_neigh(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg);
diff --git a/networking/libiproute/ip_parse_common_args.c b/networking/libiproute/ip_parse_common_args.c
index 64386c9dd..00a891232 100644
--- a/networking/libiproute/ip_parse_common_args.c
+++ b/networking/libiproute/ip_parse_common_args.c
@@ -24,7 +24,7 @@
24 24
25int preferred_family = AF_UNSPEC; 25int preferred_family = AF_UNSPEC;
26int oneline = 0; 26int oneline = 0;
27char * _SL_ = NULL; 27const char * _SL_ = NULL;
28 28
29void ip_parse_common_args(int *argcp, char ***argvp) 29void ip_parse_common_args(int *argcp, char ***argvp)
30{ 30{
diff --git a/networking/libiproute/iplink.c b/networking/libiproute/iplink.c
index ae41ab308..cb6ee962b 100644
--- a/networking/libiproute/iplink.c
+++ b/networking/libiproute/iplink.c
@@ -25,7 +25,7 @@
25/* take from linux/sockios.h */ 25/* take from linux/sockios.h */
26#define SIOCSIFNAME 0x8923 /* set interface name */ 26#define SIOCSIFNAME 0x8923 /* set interface name */
27 27
28static int on_off(char *msg) 28static int on_off(const char *msg)
29{ 29{
30 bb_error_msg("error: argument of \"%s\" must be \"on\" or \"off\"", msg); 30 bb_error_msg("error: argument of \"%s\" must be \"on\" or \"off\"", msg);
31 return -1; 31 return -1;
diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c
index c8a58c11c..27d37ac79 100644
--- a/networking/libiproute/iproute.c
+++ b/networking/libiproute/iproute.c
@@ -469,21 +469,15 @@ static int rtnl_rtcache_request(struct rtnl_handle *rth, int family)
469 469
470static int iproute_flush_cache(void) 470static int iproute_flush_cache(void)
471{ 471{
472#define ROUTE_FLUSH_PATH "/proc/sys/net/ipv4/route/flush" 472 static const char fn[] = "/proc/sys/net/ipv4/route/flush";
473 473 int flush_fd = open(fn, O_WRONLY);
474 int len;
475 int flush_fd = open (ROUTE_FLUSH_PATH, O_WRONLY);
476 char *buffer = "-1";
477
478 if (flush_fd < 0) { 474 if (flush_fd < 0) {
479 fprintf(stderr, "Cannot open \"%s\"\n", ROUTE_FLUSH_PATH); 475 bb_perror_msg("cannot open '%s'", fn);
480 return -1; 476 return -1;
481 } 477 }
482 478
483 len = strlen (buffer); 479 if (write(flush_fd, "-1", 2) < 2) {
484 480 bb_perror_msg("cannot flush routing cache");
485 if ((write (flush_fd, (void *)buffer, len)) < len) {
486 fprintf(stderr, "Cannot flush routing cache\n");
487 return -1; 481 return -1;
488 } 482 }
489 close(flush_fd); 483 close(flush_fd);
diff --git a/networking/libiproute/utils.h b/networking/libiproute/utils.h
index ebf2af194..556541f79 100644
--- a/networking/libiproute/utils.h
+++ b/networking/libiproute/utils.h
@@ -14,7 +14,8 @@ extern int show_details;
14extern int show_raw; 14extern int show_raw;
15extern int resolve_hosts; 15extern int resolve_hosts;
16extern int oneline; 16extern int oneline;
17extern char * _SL_; 17//FIXME! Appears in two .h files!
18extern const char * _SL_;
18 19
19#ifndef IPPROTO_ESP 20#ifndef IPPROTO_ESP
20#define IPPROTO_ESP 50 21#define IPPROTO_ESP 50