#include <unistd.h>
#include "fatal-signal.h"
#include "util.h"
-
#include "vlog.h"
-#define THIS_MODULE VLM_socket_util
+
+VLOG_DEFINE_THIS_MODULE(socket_util)
/* Sets 'fd' to non-blocking mode. Returns 0 if successful, otherwise a
* positive errno value. */
* address, into a numeric IP address in '*addr'. Returns 0 if successful,
* otherwise a positive errno value. */
int
-lookup_ip(const char *host_name, struct in_addr *addr)
+lookup_ip(const char *host_name, struct in_addr *addr)
{
if (!inet_aton(host_name, addr)) {
struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
/* Returns the error condition associated with socket 'fd' and resets the
* socket's error status. */
int
-get_socket_error(int fd)
+get_socket_error(int fd)
{
int error;
socklen_t len = sizeof(error);
}
int
-check_connection_completion(int fd)
+check_connection_completion(int fd)
{
struct pollfd pfd;
int retval;
make_sockaddr_un(connect_path, &un, &un_len);
if (connect(fd, (struct sockaddr*) &un, un_len)
&& errno != EINPROGRESS) {
- printf("connect failed with %s\n", strerror(errno));
goto error;
}
}
struct sockaddr_in sin;
const char *host_name;
const char *port_string;
- int fd, error, port;
+ int fd = 0, error, port;
unsigned int yes = 1;
/* Address defaults. */