32 |
#include <sys/socket.h> |
#include <sys/socket.h> |
33 |
#include <netinet/in.h> |
#include <netinet/in.h> |
34 |
#include <arpa/inet.h> |
#include <arpa/inet.h> |
35 |
|
#include "compat.h" |
36 |
|
|
37 |
int open_pipe_fd(char *command); |
int open_pipe_fd(char *command); |
38 |
int open_net_fd(char *spec); |
int open_net_fd(char *spec); |
81 |
sa.sin_port = htons(port); |
sa.sin_port = htons(port); |
82 |
he = gethostbyname(spec); |
he = gethostbyname(spec); |
83 |
if (!he) { |
if (!he) { |
84 |
|
#ifdef HAVE_HERROR |
85 |
herror("open_net_fd"); |
herror("open_net_fd"); |
86 |
|
#endif |
87 |
return -1; |
return -1; |
88 |
} |
} |
89 |
memcpy(&sa.sin_addr, he->h_addr, he->h_length); |
memcpy(&sa.sin_addr, he->h_addr, he->h_length); |