qemu-char: using qemu_set_nonblock() instead of fcntl(O_NONBLOCK)
commit4ff12bdb1d7c74d95b7315f0a00d17e5cea32249
authorGonglei <arei.gonglei@huawei.com>
Mon, 11 Aug 2014 09:34:20 +0000 (11 17:34 +0800)
committerStefan Hajnoczi <stefanha@redhat.com>
Fri, 15 Aug 2014 17:03:13 +0000 (15 18:03 +0100)
tree90189b814ba724298733a15160324af8fdcf6e91
parent271dddd133125ee00e347b154bb9d44e228929bb
qemu-char: using qemu_set_nonblock() instead of fcntl(O_NONBLOCK)

Technically, fcntl(soc, F_SETFL, O_NONBLOCK)
is incorrect since it clobbers all other file flags.
We can use F_GETFL to get the current flags, set or
clear the O_NONBLOCK flag, then use F_SETFL to set the flags.

Using the qemu_set_nonblock() wrapper.

Signed-off-by: Wangxin <wangxinxin.wang@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
qemu-char.c