From b45b76b8e09712cf06b2574a3e7baf87e545a5dc Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Wed, 7 Nov 2012 09:54:02 +0100 Subject: [PATCH] dont call sock_read() on the write path; the reader state is SOCK_RMSG and sock_read() will be called from the poll loop --- Makefile.in | 2 +- sndiod/sock.c | 16 +++------------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/Makefile.in b/Makefile.in index 4f9288f..3d50822 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,7 @@ all: cd libsndio && ${MAKE} cd aucat && ${MAKE} -# cd sndiod && ${MAKE} + cd sndiod && ${MAKE} cd examples && ${MAKE} install: diff --git a/sndiod/sock.c b/sndiod/sock.c index 172596d..4749eca 100644 --- a/sndiod/sock.c +++ b/sndiod/sock.c @@ -1633,20 +1633,10 @@ sock_write(struct sock *f) log_puts(": copied RRET message\n"); } #endif - /* - * XXX: - * the rule is to not mix read code paths and - * write code paths - */ - while (sock_read(f)) - ; + } else { + if (!sock_buildmsg(f)) + return 0; } - /* - * XXX: if sock_read blocks, we end-up here in - * the WMSG state - */ - if (!sock_buildmsg(f)) - return 0; break; #ifdef DEBUG default: