From: Carlo Marcelo Arenas Belon <carenas@sajinet.com.pe>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] NBD dead code elimination
Date: Wed, 18 Jun 2008 02:15:06 -0500 [thread overview]
Message-ID: <20080618071506.GD1486@tapir> (raw)
[-- Attachment #1: Type: text/plain, Size: 272 bytes --]
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
---
[-- Attachment #2: qemu-nbd-deadcode.patch --]
[-- Type: text/plain, Size: 1054 bytes --]
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;
next reply other threads:[~2008-06-18 6:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-18 7:15 Carlo Marcelo Arenas Belon [this message]
2008-06-18 9:00 ` [Qemu-devel] [PATCH] NBD dead code elimination Laurent Vivier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080618071506.GD1486@tapir \
--to=carenas@sajinet.com.pe \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).