diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-11-10 23:25:53 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-11-10 23:25:53 +0000 |
commit | 067e3f031a2107c69d287d89b9543fbfe5c0a571 (patch) | |
tree | 35edda4508915e2b454d0c0ec48cd548deccd744 | |
parent | 07159f0f0e2188b1ce3bf7bc6b282f08986fd5ee (diff) | |
download | busybox-w32-067e3f031a2107c69d287d89b9543fbfe5c0a571.tar.gz busybox-w32-067e3f031a2107c69d287d89b9543fbfe5c0a571.tar.bz2 busybox-w32-067e3f031a2107c69d287d89b9543fbfe5c0a571.zip |
wget: fix error message.
Bad:
wget http://127.0.0.1:81/fgdg/Makefile
Connecting to 127.0.0.1[127.0.0.1]:81
: HTTP/1.0 404 Not Foundror 404 Not Found
Good:
wget http://127.0.0.1:81/fgdg/Makefile
Connecting to 127.0.0.1[127.0.0.1]:81
get: server returned error: HTTP/1.0 404 Not Found
nslookup: fix my mistake
applets: make Bernhard Fischer <rep.nop@aon.at> happy :)
-rw-r--r-- | applets/applets.c | 2 | ||||
-rw-r--r-- | libbb/chomp.c | 5 | ||||
-rw-r--r-- | networking/nslookup.c | 2 | ||||
-rw-r--r-- | networking/wget.c | 7 |
4 files changed, 8 insertions, 8 deletions
diff --git a/applets/applets.c b/applets/applets.c index d8bb13303..23f9e4f92 100644 --- a/applets/applets.c +++ b/applets/applets.c | |||
@@ -20,7 +20,7 @@ | |||
20 | /* Apparently uclibc defines __GLIBC__ (compat trick?). Oh well. */ | 20 | /* Apparently uclibc defines __GLIBC__ (compat trick?). Oh well. */ |
21 | #if ENABLE_STATIC && defined(__GLIBC__) && !defined(__UCLIBC__) | 21 | #if ENABLE_STATIC && defined(__GLIBC__) && !defined(__UCLIBC__) |
22 | #warning Static linking against glibc produces buggy executables | 22 | #warning Static linking against glibc produces buggy executables |
23 | #warning (glibc doesn't cope well with ld --gc-sections). | 23 | #warning (glibc does not cope well with ld --gc-sections). |
24 | #warning See sources.redhat.com/bugzilla/show_bug.cgi?id=3400 | 24 | #warning See sources.redhat.com/bugzilla/show_bug.cgi?id=3400 |
25 | #warning Note that glibc is utterly unsuitable for static linking anyway. | 25 | #warning Note that glibc is utterly unsuitable for static linking anyway. |
26 | #endif | 26 | #endif |
diff --git a/libbb/chomp.c b/libbb/chomp.c index 6165b83bc..eab770760 100644 --- a/libbb/chomp.c +++ b/libbb/chomp.c | |||
@@ -8,15 +8,12 @@ | |||
8 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. | 8 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <stdio.h> | ||
12 | #include <string.h> | ||
13 | #include "libbb.h" | 11 | #include "libbb.h" |
14 | 12 | ||
15 | |||
16 | void chomp(char *s) | 13 | void chomp(char *s) |
17 | { | 14 | { |
18 | char *lc = last_char_is(s, '\n'); | 15 | char *lc = last_char_is(s, '\n'); |
19 | 16 | ||
20 | if(lc) | 17 | if (lc) |
21 | *lc = 0; | 18 | *lc = 0; |
22 | } | 19 | } |
diff --git a/networking/nslookup.c b/networking/nslookup.c index 89a2d6481..cc5ff95d6 100644 --- a/networking/nslookup.c +++ b/networking/nslookup.c | |||
@@ -82,7 +82,7 @@ static int print_host(const char *hostname, const char *header) | |||
82 | while (cur) { | 82 | while (cur) { |
83 | sockaddr_to_dotted(cur->ai_addr, str, sizeof(str)); | 83 | sockaddr_to_dotted(cur->ai_addr, str, sizeof(str)); |
84 | printf("%s %s\nAddress: %s", header, hostname, str); | 84 | printf("%s %s\nAddress: %s", header, hostname, str); |
85 | s[0] = ' '; | 85 | str[0] = ' '; |
86 | if (getnameinfo(cur->ai_addr, cur->ai_addrlen, str+1, sizeof(str)-1, NULL, 0, NI_NAMEREQD)) | 86 | if (getnameinfo(cur->ai_addr, cur->ai_addrlen, str+1, sizeof(str)-1, NULL, 0, NI_NAMEREQD)) |
87 | str[0] = '\0'; | 87 | str[0] = '\0'; |
88 | puts(str); | 88 | puts(str); |
diff --git a/networking/wget.c b/networking/wget.c index 8850fdfb7..a4c6289cb 100644 --- a/networking/wget.c +++ b/networking/wget.c | |||
@@ -324,8 +324,9 @@ int wget_main(int argc, char **argv) | |||
324 | break; | 324 | break; |
325 | /*FALLTHRU*/ | 325 | /*FALLTHRU*/ |
326 | default: | 326 | default: |
327 | chomp(buf); | 327 | /* Show first line only and kill any ESC tricks */ |
328 | bb_error_msg_and_die("server returned error %s: %s", s, buf); | 328 | buf[strcspn(buf, "\n\r\x1b")] = '\0'; |
329 | bb_error_msg_and_die("server returned error: %s", buf); | ||
329 | } | 330 | } |
330 | 331 | ||
331 | /* | 332 | /* |
@@ -585,6 +586,8 @@ static FILE *open_socket(struct sockaddr_in *s_in) | |||
585 | { | 586 | { |
586 | FILE *fp; | 587 | FILE *fp; |
587 | 588 | ||
589 | /* glibc 2.4 seems to try seeking on it - ??! */ | ||
590 | /* hopefully it understands what ESPIPE means... */ | ||
588 | fp = fdopen(xconnect_tcp_v4(s_in), "r+"); | 591 | fp = fdopen(xconnect_tcp_v4(s_in), "r+"); |
589 | if (fp == NULL) | 592 | if (fp == NULL) |
590 | bb_perror_msg_and_die("fdopen"); | 593 | bb_perror_msg_and_die("fdopen"); |