aboutsummaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorkraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-01-31 19:00:21 +0000
committerkraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-01-31 19:00:21 +0000
commitdaa692b64776f1e2552a198ae786d2e5f3b50620 (patch)
tree3933adefa4171173db78fa2389146ac89f4edb86 /networking
parent434f1b16e15a308f02d9fc1adc5fa1e483955fed (diff)
downloadbusybox-w32-daa692b64776f1e2552a198ae786d2e5f3b50620.tar.gz
busybox-w32-daa692b64776f1e2552a198ae786d2e5f3b50620.tar.bz2
busybox-w32-daa692b64776f1e2552a198ae786d2e5f3b50620.zip
Removed trailing \n from error_msg{,_and_die} messages.
git-svn-id: svn://busybox.net/trunk/busybox@1732 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'networking')
-rw-r--r--networking/hostname.c4
-rw-r--r--networking/nc.c2
-rw-r--r--networking/ping.c14
-rw-r--r--networking/telnet.c4
-rw-r--r--networking/wget.c14
5 files changed, 19 insertions, 19 deletions
diff --git a/networking/hostname.c b/networking/hostname.c
index a789fa0f1..3dba64154 100644
--- a/networking/hostname.c
+++ b/networking/hostname.c
@@ -1,6 +1,6 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * $Id: hostname.c,v 1.21 2001/01/27 08:24:37 andersen Exp $ 3 * $Id: hostname.c,v 1.22 2001/01/31 19:00:20 kraai Exp $
4 * Mini hostname implementation for busybox 4 * Mini hostname implementation for busybox
5 * 5 *
6 * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> 6 * Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@@ -41,7 +41,7 @@ void do_sethostname(char *s, int isfile)
41 if (!isfile) { 41 if (!isfile) {
42 if (sethostname(s, strlen(s)) < 0) { 42 if (sethostname(s, strlen(s)) < 0) {
43 if (errno == EPERM) 43 if (errno == EPERM)
44 error_msg_and_die("you must be root to change the hostname\n"); 44 error_msg_and_die("you must be root to change the hostname");
45 else 45 else
46 perror_msg_and_die("sethostname"); 46 perror_msg_and_die("sethostname");
47 } 47 }
diff --git a/networking/nc.c b/networking/nc.c
index 7de4015ac..682da82bf 100644
--- a/networking/nc.c
+++ b/networking/nc.c
@@ -59,7 +59,7 @@ int nc_main(int argc, char **argv)
59 perror_msg_and_die("socket"); 59 perror_msg_and_die("socket");
60 60
61 if ((hostinfo = gethostbyname(*argv)) == NULL) 61 if ((hostinfo = gethostbyname(*argv)) == NULL)
62 error_msg_and_die("cannot resolve %s\n", *argv); 62 error_msg_and_die("cannot resolve %s", *argv);
63 63
64 address.sin_family = AF_INET; 64 address.sin_family = AF_INET;
65 address.sin_addr = *(struct in_addr *) *hostinfo->h_addr_list; 65 address.sin_addr = *(struct in_addr *) *hostinfo->h_addr_list;
diff --git a/networking/ping.c b/networking/ping.c
index a2e916362..15611babd 100644
--- a/networking/ping.c
+++ b/networking/ping.c
@@ -1,6 +1,6 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * $Id: ping.c,v 1.35 2001/01/27 08:24:37 andersen Exp $ 3 * $Id: ping.c,v 1.36 2001/01/31 19:00:21 kraai Exp $
4 * Mini ping implementation for busybox 4 * Mini ping implementation for busybox
5 * 5 *
6 * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> 6 * Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@@ -203,7 +203,7 @@ static void ping(const char *host)
203 203
204 pingaddr.sin_family = AF_INET; 204 pingaddr.sin_family = AF_INET;
205 if (!(h = gethostbyname(host))) { 205 if (!(h = gethostbyname(host))) {
206 error_msg("unknown host %s\n", host); 206 error_msg("unknown host %s", host);
207 exit(1); 207 exit(1);
208 } 208 }
209 memcpy(&pingaddr.sin_addr, h->h_addr, sizeof(pingaddr.sin_addr)); 209 memcpy(&pingaddr.sin_addr, h->h_addr, sizeof(pingaddr.sin_addr));
@@ -324,7 +324,7 @@ static void sendping(int junk)
324 if (i < 0) 324 if (i < 0)
325 perror_msg_and_die("sendto"); 325 perror_msg_and_die("sendto");
326 else if ((size_t)i != sizeof(packet)) 326 else if ((size_t)i != sizeof(packet))
327 error_msg_and_die("ping wrote %d chars; %d expected\n", i, 327 error_msg_and_die("ping wrote %d chars; %d expected", i,
328 (int)sizeof(packet)); 328 (int)sizeof(packet));
329 329
330 signal(SIGALRM, sendping); 330 signal(SIGALRM, sendping);
@@ -419,7 +419,7 @@ static void unpack(char *buf, int sz, struct sockaddr_in *from)
419 printf("\n"); 419 printf("\n");
420 } else 420 } else
421 if (icmppkt->icmp_type != ICMP_ECHO) 421 if (icmppkt->icmp_type != ICMP_ECHO)
422 error_msg("Warning: Got ICMP %d (%s)\n", 422 error_msg("Warning: Got ICMP %d (%s)",
423 icmppkt->icmp_type, icmp_type_name (icmppkt->icmp_type)); 423 icmppkt->icmp_type, icmp_type_name (icmppkt->icmp_type));
424} 424}
425 425
@@ -437,7 +437,7 @@ static void ping(const char *host)
437 if ((pingsock = socket(AF_INET, SOCK_RAW, 437 if ((pingsock = socket(AF_INET, SOCK_RAW,
438 (proto ? proto->p_proto : 1))) < 0) { /* 1 == ICMP */ 438 (proto ? proto->p_proto : 1))) < 0) { /* 1 == ICMP */
439 if (errno == EPERM) 439 if (errno == EPERM)
440 error_msg_and_die("permission denied. (are you root?)\n"); 440 error_msg_and_die("permission denied. (are you root?)");
441 else 441 else
442 perror_msg_and_die("creating a raw socket"); 442 perror_msg_and_die("creating a raw socket");
443 } 443 }
@@ -449,12 +449,12 @@ static void ping(const char *host)
449 449
450 pingaddr.sin_family = AF_INET; 450 pingaddr.sin_family = AF_INET;
451 if (!(h = gethostbyname(host))) { 451 if (!(h = gethostbyname(host))) {
452 error_msg("unknown host %s\n", host); 452 error_msg("unknown host %s", host);
453 exit(1); 453 exit(1);
454 } 454 }
455 455
456 if (h->h_addrtype != AF_INET) { 456 if (h->h_addrtype != AF_INET) {
457 error_msg("unknown address type; only AF_INET is currently supported.\n"); 457 error_msg("unknown address type; only AF_INET is currently supported.");
458 exit(1); 458 exit(1);
459 } 459 }
460 460
diff --git a/networking/telnet.c b/networking/telnet.c
index 8f7bbf29b..b08effed7 100644
--- a/networking/telnet.c
+++ b/networking/telnet.c
@@ -584,7 +584,7 @@ static int getport(char * p)
584 584
585 if ((unsigned)(port - 1 ) > 65534) 585 if ((unsigned)(port - 1 ) > 65534)
586 { 586 {
587 error_msg_and_die("%s: bad port number\n", p); 587 error_msg_and_die("%s: bad port number", p);
588 } 588 }
589 return port; 589 return port;
590} 590}
@@ -596,7 +596,7 @@ static struct in_addr getserver(char * host)
596 struct hostent * he; 596 struct hostent * he;
597 if ((he = gethostbyname(host)) == NULL) 597 if ((he = gethostbyname(host)) == NULL)
598 { 598 {
599 error_msg_and_die("%s: Unknown host\n", host); 599 error_msg_and_die("%s: Unknown host", host);
600 } 600 }
601 memcpy(&addr, he->h_addr, sizeof addr); 601 memcpy(&addr, he->h_addr, sizeof addr);
602 602
diff --git a/networking/wget.c b/networking/wget.c
index 729c6fdc7..70f8d1b89 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -148,7 +148,7 @@ int wget_main(int argc, char **argv)
148#endif 148#endif
149 } 149 }
150 if (do_continue && !fname_out) 150 if (do_continue && !fname_out)
151 error_msg_and_die("cannot specify continue (-c) without a filename (-O)\n"); 151 error_msg_and_die("cannot specify continue (-c) without a filename (-O)");
152 152
153 153
154 /* 154 /*
@@ -200,7 +200,7 @@ int wget_main(int argc, char **argv)
200 */ 200 */
201 if (fgets(buf, sizeof(buf), sfp) == NULL) { 201 if (fgets(buf, sizeof(buf), sfp) == NULL) {
202 close_and_delete_outfile(output, fname_out, do_continue); 202 close_and_delete_outfile(output, fname_out, do_continue);
203 error_msg_and_die("no response from server\n"); 203 error_msg_and_die("no response from server");
204 } 204 }
205 for (s = buf ; *s != '\0' && !isspace(*s) ; ++s) 205 for (s = buf ; *s != '\0' && !isspace(*s) ; ++s)
206 ; 206 ;
@@ -230,7 +230,7 @@ int wget_main(int argc, char **argv)
230 } 230 }
231 if (strcasecmp(buf, "transfer-encoding") == 0) { 231 if (strcasecmp(buf, "transfer-encoding") == 0) {
232 close_and_delete_outfile(output, fname_out, do_continue); 232 close_and_delete_outfile(output, fname_out, do_continue);
233 error_msg_and_die("server wants to do %s transfer encoding\n", s); 233 error_msg_and_die("server wants to do %s transfer encoding", s);
234 continue; 234 continue;
235 } 235 }
236 } 236 }
@@ -267,7 +267,7 @@ void parse_url(char *url, char **uri_host, int *uri_port, char **uri_path)
267 *uri_port = 80; 267 *uri_port = 80;
268 268
269 if (strncmp(url, "http://", 7) != 0) 269 if (strncmp(url, "http://", 7) != 0)
270 error_msg_and_die("not an http url: %s\n", url); 270 error_msg_and_die("not an http url: %s", url);
271 271
272 *uri_host = url + 7; 272 *uri_host = url + 7;
273 273
@@ -297,7 +297,7 @@ FILE *open_socket(char *host, int port)
297 memset(&sin, 0, sizeof(sin)); 297 memset(&sin, 0, sizeof(sin));
298 sin.sin_family = AF_INET; 298 sin.sin_family = AF_INET;
299 if ((hp = (struct hostent *) gethostbyname(host)) == NULL) 299 if ((hp = (struct hostent *) gethostbyname(host)) == NULL)
300 error_msg_and_die("cannot resolve %s\n", host); 300 error_msg_and_die("cannot resolve %s", host);
301 memcpy(&sin.sin_addr, hp->h_addr_list[0], hp->h_length); 301 memcpy(&sin.sin_addr, hp->h_addr_list[0], hp->h_length);
302 sin.sin_port = htons(port); 302 sin.sin_port = htons(port);
303 303
@@ -338,7 +338,7 @@ char *gethdr(char *buf, size_t bufsiz, FILE *fp, int *istrunc)
338 338
339 /* verify we are at the end of the header name */ 339 /* verify we are at the end of the header name */
340 if (*s != ':') 340 if (*s != ':')
341 error_msg_and_die("bad header line: %s\n", buf); 341 error_msg_and_die("bad header line: %s", buf);
342 342
343 /* locate the start of the header value */ 343 /* locate the start of the header value */
344 for (*s++ = '\0' ; *s == ' ' || *s == '\t' ; ++s) 344 for (*s++ = '\0' ; *s == ' ' || *s == '\t' ; ++s)
@@ -532,7 +532,7 @@ progressmeter(int flag)
532 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 532 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
533 * SUCH DAMAGE. 533 * SUCH DAMAGE.
534 * 534 *
535 * $Id: wget.c,v 1.24 2001/01/31 17:49:47 andersen Exp $ 535 * $Id: wget.c,v 1.25 2001/01/31 19:00:21 kraai Exp $
536 */ 536 */
537 537
538 538