diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-01-29 23:43:18 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-01-29 23:43:18 +0000 |
commit | 89ef65f02463b27313ff0eba806aa6e4aec10716 (patch) | |
tree | 70eab3e72843b1418ef3d88437c1f1a19169bda8 /networking/libiproute | |
parent | ab2aea44479fd6f519bccd651a37f30e792b7593 (diff) | |
download | busybox-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.h | 3 | ||||
-rw-r--r-- | networking/libiproute/ip_parse_common_args.c | 2 | ||||
-rw-r--r-- | networking/libiproute/iplink.c | 2 | ||||
-rw-r--r-- | networking/libiproute/iproute.c | 16 | ||||
-rw-r--r-- | networking/libiproute/utils.h | 3 |
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 | ||
16 | extern int preferred_family; | 16 | extern int preferred_family; |
17 | extern char * _SL_; | 17 | //FIXME! Appears in two .h files! |
18 | extern const char * _SL_; | ||
18 | 19 | ||
19 | extern void ip_parse_common_args(int *argcp, char ***argvp); | 20 | extern void ip_parse_common_args(int *argcp, char ***argvp); |
20 | extern int print_neigh(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg); | 21 | extern 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 | ||
25 | int preferred_family = AF_UNSPEC; | 25 | int preferred_family = AF_UNSPEC; |
26 | int oneline = 0; | 26 | int oneline = 0; |
27 | char * _SL_ = NULL; | 27 | const char * _SL_ = NULL; |
28 | 28 | ||
29 | void ip_parse_common_args(int *argcp, char ***argvp) | 29 | void 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 | ||
28 | static int on_off(char *msg) | 28 | static 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 | ||
470 | static int iproute_flush_cache(void) | 470 | static 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; | |||
14 | extern int show_raw; | 14 | extern int show_raw; |
15 | extern int resolve_hosts; | 15 | extern int resolve_hosts; |
16 | extern int oneline; | 16 | extern int oneline; |
17 | extern char * _SL_; | 17 | //FIXME! Appears in two .h files! |
18 | extern const char * _SL_; | ||
18 | 19 | ||
19 | #ifndef IPPROTO_ESP | 20 | #ifndef IPPROTO_ESP |
20 | #define IPPROTO_ESP 50 | 21 | #define IPPROTO_ESP 50 |