X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fsocket-util.c;h=961e00b4a19b23a4a77e09ca335db11deaccebfc;hb=aed133bf9bce8f35b666c3052907f525c803c83b;hp=bf563edaea62d70d6781ecdda83847217310e44b;hpb=0ec6cfb13b4d9ef14b90119cf662e47ed559a185;p=openvswitch diff --git a/lib/socket-util.c b/lib/socket-util.c index bf563eda..961e00b4 100644 --- a/lib/socket-util.c +++ b/lib/socket-util.c @@ -32,9 +32,9 @@ #include #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. */ @@ -98,7 +98,7 @@ get_max_fds(void) * 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); @@ -111,7 +111,7 @@ lookup_ip(const char *host_name, struct in_addr *addr) /* 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); @@ -124,7 +124,7 @@ get_socket_error(int fd) } int -check_connection_completion(int fd) +check_connection_completion(int fd) { struct pollfd pfd; int retval; @@ -270,7 +270,6 @@ make_unix_socket(int style, bool nonblock, bool passcred OVS_UNUSED, 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; } } @@ -457,7 +456,7 @@ inet_open_passive(int style, const char *target_, int default_port, 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. */