From 0b8b322500bcd224cac3a587a114e422849c56ac Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Mon, 26 Oct 2009 19:06:29 +0000 Subject: reader state cannot be IDLE, terminate the stream if so rather entering a busy loop --- lib/libsndio/aucat.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/libsndio') diff --git a/lib/libsndio/aucat.c b/lib/libsndio/aucat.c index 272df65d246..0cd2128d55c 100644 --- a/lib/libsndio/aucat.c +++ b/lib/libsndio/aucat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aucat.c,v 1.31 2009/10/24 09:35:16 ratchov Exp $ */ +/* $OpenBSD: aucat.c,v 1.32 2009/10/26 19:06:28 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov * @@ -506,8 +506,9 @@ aucat_read(struct sio_hdl *sh, void *buf, size_t len) return 0; break; case STATE_IDLE: - DPRINTF("aucat_read: unexpected idle\n"); - break; + DPRINTF("aucat_read: unexpected idle state\n"); + hdl->sio.eof = 1; + return 0; } } if (len > hdl->rtodo) -- cgit v1.2.3