From c8cf0c1ce9cf1b38b302ae4a2a6fa798fef85f08 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 14 Jun 2004 18:38:50 +0000 Subject: a bunch of fixes git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@10 fefdeb5f-60dc-0310-8127-8f9354f1896f --- src/iochannel.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/iochannel.c') diff --git a/src/iochannel.c b/src/iochannel.c index aa7de714..2044d561 100644 --- a/src/iochannel.c +++ b/src/iochannel.c @@ -41,15 +41,15 @@ static void enable_mainloop_sources(struct iochannel *io) { static void callback(struct mainloop_source*s, int fd, enum mainloop_io_event events, void *userdata) { struct iochannel *io = userdata; - int changed; + int changed = 0; assert(s && fd >= 0 && userdata); - if (events & MAINLOOP_IO_EVENT_IN && !io->readable) { + if ((events & MAINLOOP_IO_EVENT_IN) && !io->readable) { io->readable = 1; changed = 1; } - if (events & MAINLOOP_IO_EVENT_OUT && !io->writable) { + if ((events & MAINLOOP_IO_EVENT_OUT) && !io->writable) { io->writable = 1; changed = 1; } @@ -116,7 +116,7 @@ void iochannel_free(struct iochannel*io) { if (io->input_source) mainloop_source_free(io->input_source); - if (io->output_source) + if (io->output_source && io->output_source != io->input_source) mainloop_source_free(io->output_source); free(io); -- cgit