From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K8rWP-0000RN-3F for qemu-devel@nongnu.org; Wed, 18 Jun 2008 02:51:57 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K8rWO-0000R5-Dm for qemu-devel@nongnu.org; Wed, 18 Jun 2008 02:51:56 -0400 Received: from [199.232.76.173] (port=48902 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K8rWO-0000R2-91 for qemu-devel@nongnu.org; Wed, 18 Jun 2008 02:51:56 -0400 Received: from tapir.sajinet.com.pe ([66.139.79.212]:39476) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K8rWN-0005B5-OK for qemu-devel@nongnu.org; Wed, 18 Jun 2008 02:51:55 -0400 Date: Wed, 18 Jun 2008 02:15:06 -0500 From: Carlo Marcelo Arenas Belon Message-ID: <20080618071506.GD1486@tapir> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="DKU6Jbt7q3WqK7+M" Content-Disposition: inline Subject: [Qemu-devel] [PATCH] NBD dead code elimination Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --DKU6Jbt7q3WqK7+M Content-Type: text/plain; charset=us-ascii Content-Disposition: inline The following patch, removes tcp_socket_outgoing which is not being used by the current implementation, neither the proposed unix socket patches. This avoids the following compile time warning : nbd.c:99: warning: 'tcp_socket_outgoing' defined but not used Carlo --- --DKU6Jbt7q3WqK7+M Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="qemu-nbd-deadcode.patch" Index: nbd.c =================================================================== --- nbd.c (revision 4745) +++ nbd.c (working copy) @@ -95,45 +95,6 @@ return offset; } -static int tcp_socket_outgoing(const char *address, uint16_t port) -{ - int s; - struct in_addr in; - struct sockaddr_in addr; - int serrno; - - s = socket(PF_INET, SOCK_STREAM, 0); - if (s == -1) { - return -1; - } - - if (inet_aton(address, &in) == 0) { - struct hostent *ent; - - ent = gethostbyname(address); - if (ent == NULL) { - goto error; - } - - memcpy(&in, ent->h_addr, sizeof(in)); - } - - addr.sin_family = AF_INET; - addr.sin_port = htons(port); - memcpy(&addr.sin_addr.s_addr, &in, sizeof(in)); - - if (connect(s, (struct sockaddr *)&addr, sizeof(addr)) == -1) { - goto error; - } - - return s; -error: - serrno = errno; - close(s); - errno = serrno; - return -1; -} - int tcp_socket_incoming(const char *address, uint16_t port) { int s; --DKU6Jbt7q3WqK7+M--