raop: Don't crash if fd is not open when trying to close it

BugLink: http://bugs.launchpad.net/bugs/845286
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
This commit is contained in:
David Henningsson 2011-09-12 11:23:57 +02:00 committed by Colin Guthrie
parent aa3142ab20
commit f0ad6fd413

View file

@ -235,10 +235,12 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse
}
case SINK_MESSAGE_RIP_SOCKET: {
pa_assert(u->fd >= 0);
pa_close(u->fd);
u->fd = -1;
if (u->fd >= 0) {
pa_close(u->fd);
u->fd = -1;
} else
/* FIXME */
pa_log("We should not get to this state. Cannot rip socket if not connected.");
if (u->sink->thread_info.state == PA_SINK_SUSPENDED) {