diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2011-07-08 08:49:40 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-07-08 08:49:40 +0200 |
commit | 14bd16ac56e81e4912341cb731dc54af0dbe9e6c (patch) | |
tree | 729afe775b6a0b5f15e67ad93909d539aaf0429e | |
parent | acff3733bae6a9928d0109d5e4f93c32e82969d8 (diff) | |
download | busybox-w32-14bd16ac56e81e4912341cb731dc54af0dbe9e6c.tar.gz busybox-w32-14bd16ac56e81e4912341cb731dc54af0dbe9e6c.tar.bz2 busybox-w32-14bd16ac56e81e4912341cb731dc54af0dbe9e6c.zip |
more tweak for bionic
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | editors/diff.c | 4 | ||||
-rw-r--r-- | include/platform.h | 4 | ||||
-rw-r--r-- | networking/ping.c | 16 | ||||
-rw-r--r-- | networking/telnet.c | 19 | ||||
-rw-r--r-- | util-linux/acpid.c | 19 | ||||
-rw-r--r-- | util-linux/swaponoff.c | 7 |
6 files changed, 65 insertions, 4 deletions
diff --git a/editors/diff.c b/editors/diff.c index 8c0a31f47..3a3334640 100644 --- a/editors/diff.c +++ b/editors/diff.c | |||
@@ -693,10 +693,12 @@ static bool diff(FILE* fp[2], char *file[2]) | |||
693 | 693 | ||
694 | static int diffreg(char *file[2]) | 694 | static int diffreg(char *file[2]) |
695 | { | 695 | { |
696 | FILE *fp[2] = { stdin, stdin }; | 696 | FILE *fp[2]; |
697 | bool binary = false, differ = false; | 697 | bool binary = false, differ = false; |
698 | int status = STATUS_SAME, i; | 698 | int status = STATUS_SAME, i; |
699 | 699 | ||
700 | fp[0] = stdin; | ||
701 | fp[1] = stdin; | ||
700 | for (i = 0; i < 2; i++) { | 702 | for (i = 0; i < 2; i++) { |
701 | int fd = open_or_warn_stdin(file[i]); | 703 | int fd = open_or_warn_stdin(file[i]); |
702 | if (fd == -1) | 704 | if (fd == -1) |
diff --git a/include/platform.h b/include/platform.h index 07b1faa9f..e22dbdb4a 100644 --- a/include/platform.h +++ b/include/platform.h | |||
@@ -266,6 +266,7 @@ typedef unsigned smalluint; | |||
266 | #if defined __GLIBC__ \ | 266 | #if defined __GLIBC__ \ |
267 | || defined __UCLIBC__ \ | 267 | || defined __UCLIBC__ \ |
268 | || defined __dietlibc__ \ | 268 | || defined __dietlibc__ \ |
269 | || defined __BIONIC__ \ | ||
269 | || defined _NEWLIB_VERSION | 270 | || defined _NEWLIB_VERSION |
270 | # include <features.h> | 271 | # include <features.h> |
271 | #endif | 272 | #endif |
@@ -492,7 +493,8 @@ extern int vasprintf(char **string_ptr, const char *format, va_list p) FAST_FUNC | |||
492 | #endif | 493 | #endif |
493 | 494 | ||
494 | #ifndef HAVE_GETLINE | 495 | #ifndef HAVE_GETLINE |
495 | #include <stdio.h> /* for FILE */ | 496 | # include <stdio.h> /* for FILE */ |
497 | # include <sys/types.h> /* size_t */ | ||
496 | extern ssize_t getline(char **lineptr, size_t *n, FILE *stream) FAST_FUNC; | 498 | extern ssize_t getline(char **lineptr, size_t *n, FILE *stream) FAST_FUNC; |
497 | #endif | 499 | #endif |
498 | 500 | ||
diff --git a/networking/ping.c b/networking/ping.c index d75747984..efd4f210b 100644 --- a/networking/ping.c +++ b/networking/ping.c | |||
@@ -29,6 +29,22 @@ | |||
29 | #include <netinet/ip_icmp.h> | 29 | #include <netinet/ip_icmp.h> |
30 | #include "libbb.h" | 30 | #include "libbb.h" |
31 | 31 | ||
32 | #ifdef __BIONIC__ | ||
33 | /* should be in netinet/ip_icmp.h */ | ||
34 | # define ICMP_DEST_UNREACH 3 /* Destination Unreachable */ | ||
35 | # define ICMP_SOURCE_QUENCH 4 /* Source Quench */ | ||
36 | # define ICMP_REDIRECT 5 /* Redirect (change route) */ | ||
37 | # define ICMP_ECHO 8 /* Echo Request */ | ||
38 | # define ICMP_TIME_EXCEEDED 11 /* Time Exceeded */ | ||
39 | # define ICMP_PARAMETERPROB 12 /* Parameter Problem */ | ||
40 | # define ICMP_TIMESTAMP 13 /* Timestamp Request */ | ||
41 | # define ICMP_TIMESTAMPREPLY 14 /* Timestamp Reply */ | ||
42 | # define ICMP_INFO_REQUEST 15 /* Information Request */ | ||
43 | # define ICMP_INFO_REPLY 16 /* Information Reply */ | ||
44 | # define ICMP_ADDRESS 17 /* Address Mask Request */ | ||
45 | # define ICMP_ADDRESSREPLY 18 /* Address Mask Reply */ | ||
46 | #endif | ||
47 | |||
32 | //config:config PING | 48 | //config:config PING |
33 | //config: bool "ping" | 49 | //config: bool "ping" |
34 | //config: default y | 50 | //config: default y |
diff --git a/networking/telnet.c b/networking/telnet.c index 6dd0de53a..e8e51dce4 100644 --- a/networking/telnet.c +++ b/networking/telnet.c | |||
@@ -40,10 +40,25 @@ | |||
40 | #include <netinet/in.h> | 40 | #include <netinet/in.h> |
41 | #include "libbb.h" | 41 | #include "libbb.h" |
42 | 42 | ||
43 | #ifdef __BIONIC__ | ||
44 | /* should be in arpa/telnet.h */ | ||
45 | # define IAC 255 /* interpret as command: */ | ||
46 | # define DONT 254 /* you are not to use option */ | ||
47 | # define DO 253 /* please, you use option */ | ||
48 | # define WONT 252 /* I won't use option */ | ||
49 | # define WILL 251 /* I will use option */ | ||
50 | # define SB 250 /* interpret as subnegotiation */ | ||
51 | # define SE 240 /* end sub negotiation */ | ||
52 | # define TELOPT_ECHO 1 /* echo */ | ||
53 | # define TELOPT_SGA 3 /* suppress go ahead */ | ||
54 | # define TELOPT_TTYPE 24 /* terminal type */ | ||
55 | # define TELOPT_NAWS 31 /* window size */ | ||
56 | #endif | ||
57 | |||
43 | #ifdef DOTRACE | 58 | #ifdef DOTRACE |
44 | #define TRACE(x, y) do { if (x) printf y; } while (0) | 59 | # define TRACE(x, y) do { if (x) printf y; } while (0) |
45 | #else | 60 | #else |
46 | #define TRACE(x, y) | 61 | # define TRACE(x, y) |
47 | #endif | 62 | #endif |
48 | 63 | ||
49 | enum { | 64 | enum { |
diff --git a/util-linux/acpid.c b/util-linux/acpid.c index 2f27cfd1c..6e7321b02 100644 --- a/util-linux/acpid.c +++ b/util-linux/acpid.c | |||
@@ -33,6 +33,25 @@ | |||
33 | #include <syslog.h> | 33 | #include <syslog.h> |
34 | #include <linux/input.h> | 34 | #include <linux/input.h> |
35 | 35 | ||
36 | #ifndef EV_SW | ||
37 | # define EV_SW 0x05 | ||
38 | #endif | ||
39 | #ifndef EV_KEY | ||
40 | # define EV_KEY 0x01 | ||
41 | #endif | ||
42 | #ifndef SW_LID | ||
43 | # define SW_LID 0x00 | ||
44 | #endif | ||
45 | #ifndef SW_RFKILL_ALL | ||
46 | # define SW_RFKILL_ALL 0x03 | ||
47 | #endif | ||
48 | #ifndef KEY_POWER | ||
49 | # define KEY_POWER 116 /* SC System Power Down */ | ||
50 | #endif | ||
51 | #ifndef KEY_SLEEP | ||
52 | # define KEY_SLEEP 142 /* SC System Sleep */ | ||
53 | #endif | ||
54 | |||
36 | enum { | 55 | enum { |
37 | OPT_c = (1 << 0), | 56 | OPT_c = (1 << 0), |
38 | OPT_d = (1 << 1), | 57 | OPT_d = (1 << 1), |
diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c index dbefa4cf2..43ddb4031 100644 --- a/util-linux/swaponoff.c +++ b/util-linux/swaponoff.c | |||
@@ -25,6 +25,9 @@ | |||
25 | #include "libbb.h" | 25 | #include "libbb.h" |
26 | #include <mntent.h> | 26 | #include <mntent.h> |
27 | #include <sys/swap.h> | 27 | #include <sys/swap.h> |
28 | #ifndef __BIONIC__ | ||
29 | # include <sys/swap.h> | ||
30 | #endif | ||
28 | 31 | ||
29 | #if ENABLE_FEATURE_MOUNT_LABEL | 32 | #if ENABLE_FEATURE_MOUNT_LABEL |
30 | # include "volume_id.h" | 33 | # include "volume_id.h" |
@@ -32,6 +35,10 @@ | |||
32 | # define resolve_mount_spec(fsname) ((void)0) | 35 | # define resolve_mount_spec(fsname) ((void)0) |
33 | #endif | 36 | #endif |
34 | 37 | ||
38 | #ifndef MNTTYPE_SWAP | ||
39 | # define MNTTYPE_SWAP "swap" | ||
40 | #endif | ||
41 | |||
35 | #if ENABLE_FEATURE_SWAPON_PRI | 42 | #if ENABLE_FEATURE_SWAPON_PRI |
36 | struct globals { | 43 | struct globals { |
37 | int flags; | 44 | int flags; |