move socket_set_nodelay to osdep.c
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
4ef7b8944c
commit
bf1c852aa9
6 changed files with 11 additions and 21 deletions
|
|
@ -787,15 +787,6 @@ static int aio_flush_request(void *opaque)
|
|||
!QLIST_EMPTY(&s->pending_aio_head);
|
||||
}
|
||||
|
||||
static int set_nodelay(int fd)
|
||||
{
|
||||
int ret, opt;
|
||||
|
||||
opt = 1;
|
||||
ret = setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char *)&opt, sizeof(opt));
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return a socket discriptor to read/write objects.
|
||||
*
|
||||
|
|
@ -814,7 +805,7 @@ static int get_sheep_fd(BDRVSheepdogState *s)
|
|||
|
||||
socket_set_nonblock(fd);
|
||||
|
||||
ret = set_nodelay(fd);
|
||||
ret = socket_set_nodelay(fd);
|
||||
if (ret) {
|
||||
error_report("%s", strerror(errno));
|
||||
closesocket(fd);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue