slirp: Handle error returns from slirp_send() in sosendoob()
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 5 Jun 2017 16:19:35 +0000 (17:19 +0100)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Sat, 15 Jul 2017 12:28:25 +0000 (14:28 +0200)
commit0b466065eba289c437e3edc2e97144fc5cd6a889
treee4fe50d73589d8ee0bd2c9b671ad4d0cda876bcd
parent12dccfe4f57ead8166567ec8a60d2ce91e266f04
slirp: Handle error returns from slirp_send() in sosendoob()

The code in sosendoob() assumes that slirp_send() always
succeeds, but it might return an OS error code (for instance
if the other end has disconnected). Catch these and return
the caller either -1 on error or the number of urgent bytes
actually written. (None of the callers check this return
value currently, though.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
slirp/socket.c