aboutsummaryrefslogtreecommitdiff
path: root/networking/tftp.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-08-03 15:41:12 +0000
committerRob Landley <rob@landley.net>2006-08-03 15:41:12 +0000
commitd921b2ecc0d294ad4bf8c7458fc52a60c28727d2 (patch)
treee4a2769349867c441cf2983d83097bb66701a733 /networking/tftp.c
parent6dce0b6fa79f2d4bb7e9d90e1fbc0f6beb25f855 (diff)
downloadbusybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.gz
busybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.bz2
busybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.zip
Remove bb_ prefixes from xfuncs.c (and a few other places), consolidate
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only had one user), clean up lots of #includes... General cleanup pass. What I've been doing for the last couple days. And it conflicts! I've removed httpd.c from this checkin due to somebody else touching that file. It builds for me. I have to catch a bus. (Now you know why I'm looking forward to Mercurial.)
Diffstat (limited to 'networking/tftp.c')
-rw-r--r--networking/tftp.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/networking/tftp.c b/networking/tftp.c
index dfa599ab5..42fd9d2ca 100644
--- a/networking/tftp.c
+++ b/networking/tftp.c
@@ -19,18 +19,6 @@
19 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 19 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
20 * ------------------------------------------------------------------------- */ 20 * ------------------------------------------------------------------------- */
21 21
22#include <stdio.h>
23#include <stdlib.h>
24#include <string.h>
25#include <sys/types.h>
26#include <sys/socket.h>
27#include <sys/stat.h>
28#include <netdb.h>
29#include <netinet/in.h>
30#include <arpa/inet.h>
31#include <unistd.h>
32#include <fcntl.h>
33
34#include "busybox.h" 22#include "busybox.h"
35 23
36 24
@@ -159,7 +147,7 @@ static int tftp(const int cmd, const struct hostent *host,
159 char *buf=xmalloc(tftp_bufsize += 4); 147 char *buf=xmalloc(tftp_bufsize += 4);
160 148
161 if ((socketfd = socket(PF_INET, SOCK_DGRAM, 0)) < 0) { 149 if ((socketfd = socket(PF_INET, SOCK_DGRAM, 0)) < 0) {
162 /* need to unlink the localfile, so don't use bb_xsocket here. */ 150 /* need to unlink the localfile, so don't use xsocket here. */
163 bb_perror_msg("socket"); 151 bb_perror_msg("socket");
164 return EXIT_FAILURE; 152 return EXIT_FAILURE;
165 } 153 }
@@ -167,7 +155,7 @@ static int tftp(const int cmd, const struct hostent *host,
167 len = sizeof(sa); 155 len = sizeof(sa);
168 156
169 memset(&sa, 0, len); 157 memset(&sa, 0, len);
170 bb_xbind(socketfd, (struct sockaddr *)&sa, len); 158 xbind(socketfd, (struct sockaddr *)&sa, len);
171 159
172 sa.sin_family = host->h_addrtype; 160 sa.sin_family = host->h_addrtype;
173 sa.sin_port = port; 161 sa.sin_port = port;