qemu/io
Peter Xu 8bd9c4e6c5 io: fix qio_channel_socket_accept err handling
When accept failed, we should setup errp with the reason. More
importantly, the caller may assume errp be non-NULL when error happens,
and not setting the errp may crash QEMU.

At the same time, move the trace_qio_channel_socket_accept_fail() after
the if check on EINTR. Two reasons:

1. when EINTR happened, it's not really a fault (we should just try
   again), so we should not log with an "accept failure".

2. trace_*() functions may overwrite errno, then the old errno will be
   missing. We need to either check errno before trace_*() calls, or
   reserve the errno.

Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <1501666880-10159-3-git-send-email-peterx@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2017-08-02 11:27:44 +01:00
..
channel-buffer.c
channel-command.c
channel-file.c
channel-socket.c io: fix qio_channel_socket_accept err handling 2017-08-02 11:27:44 +01:00
channel-tls.c
channel-util.c
channel-watch.c
channel-websock.c
channel.c
dns-resolver.c io: preserve ipv4/ipv6 flags when resolving InetSocketAddress 2017-07-14 14:28:29 +01:00
Makefile.objs
task.c
trace-events docs: fix broken paths to docs/devel/tracing.txt 2017-07-31 13:12:53 +03:00