diff options
author | Mark Whitley <markw@lineo.com> | 2000-12-07 19:56:48 +0000 |
---|---|---|
committer | Mark Whitley <markw@lineo.com> | 2000-12-07 19:56:48 +0000 |
commit | f57c944e09417edcbcd69f2b01b937cadef39db2 (patch) | |
tree | a55822621d54bd82c54e272fa986e45698fea0f1 /networking | |
parent | 7b5c16ebe5f1b057603cf1c0b0187be418725c42 (diff) | |
download | busybox-f57c944e09417edcbcd69f2b01b937cadef39db2.tar.gz |
Changed names of functions in utility.c and all affected files, to make
compliant with the style guide. Everybody rebuild your tags file!
Diffstat (limited to 'networking')
-rw-r--r-- | networking/hostname.c | 4 | ||||
-rw-r--r-- | networking/nc.c | 2 | ||||
-rw-r--r-- | networking/ping.c | 18 | ||||
-rw-r--r-- | networking/telnet.c | 6 | ||||
-rw-r--r-- | networking/wget.c | 30 |
5 files changed, 30 insertions, 30 deletions
diff --git a/networking/hostname.c b/networking/hostname.c index 44d529c83..13e52c41d 100644 --- a/networking/hostname.c +++ b/networking/hostname.c @@ -1,6 +1,6 @@ /* vi: set sw=4 ts=4: */ /* - * $Id: hostname.c,v 1.15 2000/10/12 22:30:31 andersen Exp $ + * $Id: hostname.c,v 1.16 2000/12/07 19:56:48 markw Exp $ * Mini hostname implementation for busybox * * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> @@ -40,7 +40,7 @@ void do_sethostname(char *s, int isfile) if (!isfile) { if (sethostname(s, strlen(s)) < 0) { if (errno == EPERM) - errorMsg("you must be root to change the hostname\n"); + error_msg("you must be root to change the hostname\n"); else perror("sethostname"); exit(1); diff --git a/networking/nc.c b/networking/nc.c index fcacb0c45..805bbd4d8 100644 --- a/networking/nc.c +++ b/networking/nc.c @@ -63,7 +63,7 @@ int nc_main(int argc, char **argv) hostinfo = (struct hostent *) gethostbyname(*argv); if (!hostinfo) { - fatalError("cannot resolve %s\n", *argv); + error_msg_and_die("cannot resolve %s\n", *argv); } address.sin_family = AF_INET; diff --git a/networking/ping.c b/networking/ping.c index af109cf0a..ccc535b26 100644 --- a/networking/ping.c +++ b/networking/ping.c @@ -1,6 +1,6 @@ /* vi: set sw=4 ts=4: */ /* - * $Id: ping.c,v 1.27 2000/12/01 02:55:13 kraai Exp $ + * $Id: ping.c,v 1.28 2000/12/07 19:56:48 markw Exp $ * Mini ping implementation for busybox * * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> @@ -202,7 +202,7 @@ static void ping(const char *host) pingaddr.sin_family = AF_INET; if (!(h = gethostbyname(host))) { - errorMsg("unknown host %s\n", host); + error_msg("unknown host %s\n", host); exit(1); } memcpy(&pingaddr.sin_addr, h->h_addr, sizeof(pingaddr.sin_addr)); @@ -219,7 +219,7 @@ static void ping(const char *host) if (c < 0 || c != sizeof(packet)) { if (c < 0) perror("ping: sendto"); - errorMsg("write incomplete\n"); + error_msg("write incomplete\n"); exit(1); } @@ -325,9 +325,9 @@ static void sendping(int junk) (struct sockaddr *) &pingaddr, sizeof(struct sockaddr_in)); if (i < 0) - fatalError("sendto: %s\n", strerror(errno)); + error_msg_and_die("sendto: %s\n", strerror(errno)); else if ((size_t)i != sizeof(packet)) - fatalError("ping wrote %d chars; %d expected\n", i, + error_msg_and_die("ping wrote %d chars; %d expected\n", i, (int)sizeof(packet)); signal(SIGALRM, sendping); @@ -422,7 +422,7 @@ static void unpack(char *buf, int sz, struct sockaddr_in *from) printf("\n"); } else if (icmppkt->icmp_type != ICMP_ECHO) - errorMsg("Warning: Got ICMP %d (%s)\n", + error_msg("Warning: Got ICMP %d (%s)\n", icmppkt->icmp_type, icmp_type_name (icmppkt->icmp_type)); } @@ -440,7 +440,7 @@ static void ping(const char *host) if ((pingsock = socket(AF_INET, SOCK_RAW, (proto ? proto->p_proto : 1))) < 0) { /* 1 == ICMP */ if (errno == EPERM) { - errorMsg("permission denied. (are you root?)\n"); + error_msg("permission denied. (are you root?)\n"); } else { perror("ping: creating a raw socket"); } @@ -454,12 +454,12 @@ static void ping(const char *host) pingaddr.sin_family = AF_INET; if (!(h = gethostbyname(host))) { - errorMsg("unknown host %s\n", host); + error_msg("unknown host %s\n", host); exit(1); } if (h->h_addrtype != AF_INET) { - errorMsg("unknown address type; only AF_INET is currently supported.\n"); + error_msg("unknown address type; only AF_INET is currently supported.\n"); exit(1); } diff --git a/networking/telnet.c b/networking/telnet.c index bfa964460..7a7bcfb9f 100644 --- a/networking/telnet.c +++ b/networking/telnet.c @@ -583,7 +583,7 @@ static int getport(char * p) if ((unsigned)(port - 1 ) > 65534) { - fatalError("%s: bad port number\n", p); + error_msg_and_die("%s: bad port number\n", p); } return port; } @@ -595,7 +595,7 @@ static struct in_addr getserver(char * host) struct hostent * he; if ((he = gethostbyname(host)) == NULL) { - fatalError("%s: Unknown host\n", host); + error_msg_and_die("%s: Unknown host\n", host); } memcpy(&addr, he->h_addr, sizeof addr); @@ -650,7 +650,7 @@ static int remote_connect(struct in_addr addr, int port) if (connect(s, (struct sockaddr *)&s_addr, sizeof s_addr) < 0) { - fatalError("Unable to connect to remote host: %s\n", strerror(errno)); + error_msg_and_die("Unable to connect to remote host: %s\n", strerror(errno)); } return s; } diff --git a/networking/wget.c b/networking/wget.c index b43bbad62..0ec4dff19 100644 --- a/networking/wget.c +++ b/networking/wget.c @@ -100,7 +100,7 @@ int wget_main(int argc, char **argv) if (do_continue && !fname_out) - fatalError("cannot specify continue (-c) without a filename (-O)\n"); + error_msg_and_die("cannot specify continue (-c) without a filename (-O)\n"); /* * Parse url into components. */ @@ -117,7 +117,7 @@ int wget_main(int argc, char **argv) if (fname_out != (char *)1) { if ( (output=fopen(fname_out, (do_continue ? "a" : "w"))) == NULL) - fatalPerror("fopen(%s)", fname_out); + perror_msg_and_die("fopen(%s)", fname_out); } else { output = stdout; } @@ -128,7 +128,7 @@ int wget_main(int argc, char **argv) if (do_continue) { struct stat sbuf; if (fstat(fileno(output), &sbuf) < 0) - fatalError("fstat()"); + error_msg_and_die("fstat()"); if (sbuf.st_size > 0) beg_range = sbuf.st_size; else @@ -147,7 +147,7 @@ int wget_main(int argc, char **argv) * Retrieve HTTP response line and check for "200" status code. */ if (fgets(buf, sizeof(buf), sfp) == NULL) - fatalError("no response from server\n"); + error_msg_and_die("no response from server\n"); for (s = buf ; *s != '\0' && !isspace(*s) ; ++s) ; for ( ; isspace(*s) ; ++s) @@ -156,13 +156,13 @@ int wget_main(int argc, char **argv) case 200: if (!do_continue) break; - fatalError("server does not support ranges\n"); + error_msg_and_die("server does not support ranges\n"); case 206: if (do_continue) break; /*FALLTHRU*/ default: - fatalError("server returned error: %s", buf); + error_msg_and_die("server returned error: %s", buf); } /* @@ -175,7 +175,7 @@ int wget_main(int argc, char **argv) continue; } if (strcmp(buf, "transfer-encoding") == 0) { - fatalError("server wants to do %s transfer encoding\n", s); + error_msg_and_die("server wants to do %s transfer encoding\n", s); continue; } } @@ -197,7 +197,7 @@ int wget_main(int argc, char **argv) filesize -= n; } if (n == 0 && ferror(sfp)) - fatalPerror("network read error"); + perror_msg_and_die("network read error"); exit(0); } @@ -211,7 +211,7 @@ void parse_url(char *url, char **uri_host, int *uri_port, char **uri_path) *uri_port = 80; if (strncmp(url, "http://", 7) != 0) - fatalError("not an http url: %s\n", url); + error_msg_and_die("not an http url: %s\n", url); /* pull the host portion to the front of the buffer */ for (s = url, h = url+7 ; *h != '/' && *h != 0; ++h) { @@ -240,7 +240,7 @@ FILE *open_socket(char *host, int port) memzero(&sin, sizeof(sin)); sin.sin_family = AF_INET; if ((hp = (struct hostent *) gethostbyname(host)) == NULL) - fatalError("cannot resolve %s\n", host); + error_msg_and_die("cannot resolve %s\n", host); memcpy(&sin.sin_addr, hp->h_addr_list[0], hp->h_length); sin.sin_port = htons(port); @@ -248,11 +248,11 @@ FILE *open_socket(char *host, int port) * Get the server onto a stdio stream. */ if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) - fatalPerror("socket()"); + perror_msg_and_die("socket()"); if (connect(fd, (struct sockaddr *) &sin, sizeof(sin)) < 0) - fatalPerror("connect(%s)", host); + perror_msg_and_die("connect(%s)", host); if ((fp = fdopen(fd, "r+")) == NULL) - fatalPerror("fdopen()"); + perror_msg_and_die("fdopen()"); return fp; } @@ -281,7 +281,7 @@ char *gethdr(char *buf, size_t bufsiz, FILE *fp, int *istrunc) /* verify we are at the end of the header name */ if (*s != ':') - fatalError("bad header line: %s\n", buf); + error_msg_and_die("bad header line: %s\n", buf); /* locate the start of the header value */ for (*s++ = '\0' ; *s == ' ' || *s == '\t' ; ++s) @@ -475,7 +475,7 @@ progressmeter(int flag) * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: wget.c,v 1.9 2000/12/07 03:55:35 tausq Exp $ + * $Id: wget.c,v 1.10 2000/12/07 19:56:48 markw Exp $ */ |