diff options
Diffstat (limited to 'wget.c')
-rw-r--r-- | wget.c | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -33,6 +33,18 @@ | |||
33 | #include <arpa/inet.h> | 33 | #include <arpa/inet.h> |
34 | #include <netdb.h> | 34 | #include <netdb.h> |
35 | 35 | ||
36 | /* Stupid libc5 doesn't define this... */ | ||
37 | #ifndef timersub | ||
38 | #define timersub(a, b, result) \ | ||
39 | do { \ | ||
40 | (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ | ||
41 | (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ | ||
42 | if ((result)->tv_usec < 0) { \ | ||
43 | --(result)->tv_sec; \ | ||
44 | (result)->tv_usec += 1000000; \ | ||
45 | } \ | ||
46 | } while (0) | ||
47 | #endif | ||
36 | 48 | ||
37 | void parse_url(char *url, char **uri_host, int *uri_port, char **uri_path); | 49 | void parse_url(char *url, char **uri_host, int *uri_port, char **uri_path); |
38 | FILE *open_socket(char *host, int port); | 50 | FILE *open_socket(char *host, int port); |
@@ -283,7 +295,7 @@ FILE *open_socket(char *host, int port) | |||
283 | int fd; | 295 | int fd; |
284 | FILE *fp; | 296 | FILE *fp; |
285 | 297 | ||
286 | memzero(&sin, sizeof(sin)); | 298 | memset(&sin, 0, sizeof(sin)); |
287 | sin.sin_family = AF_INET; | 299 | sin.sin_family = AF_INET; |
288 | if ((hp = (struct hostent *) gethostbyname(host)) == NULL) | 300 | if ((hp = (struct hostent *) gethostbyname(host)) == NULL) |
289 | error_msg_and_die("cannot resolve %s\n", host); | 301 | error_msg_and_die("cannot resolve %s\n", host); |
@@ -521,7 +533,7 @@ progressmeter(int flag) | |||
521 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 533 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
522 | * SUCH DAMAGE. | 534 | * SUCH DAMAGE. |
523 | * | 535 | * |
524 | * $Id: wget.c,v 1.22 2001/01/26 02:04:49 andersen Exp $ | 536 | * $Id: wget.c,v 1.23 2001/01/27 08:24:38 andersen Exp $ |
525 | */ | 537 | */ |
526 | 538 | ||
527 | 539 | ||