From 338b21d06d747acdffcc8af1e2a191e8e42cac69 Mon Sep 17 00:00:00 2001 From: nat Date: Sat, 1 Jul 2017 05:32:24 +0000 Subject: [PATCH] Don't keep writing data if an error has occurred. --- sys/dev/audiobell.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/dev/audiobell.c b/sys/dev/audiobell.c index f671035af9f3..7c9fd6654680 100644 --- a/sys/dev/audiobell.c +++ b/sys/dev/audiobell.c @@ -1,4 +1,4 @@ -/* $NetBSD: audiobell.c,v 1.24 2017/06/27 09:44:13 nat Exp $ */ +/* $NetBSD: audiobell.c,v 1.25 2017/07/01 05:32:24 nat Exp $ */ /* @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: audiobell.c,v 1.24 2017/06/27 09:44:13 nat Exp $"); +__KERNEL_RCSID(0, "$NetBSD: audiobell.c,v 1.25 2017/07/01 05:32:24 nat Exp $"); #include #include @@ -170,7 +170,8 @@ audiobell(void *v, u_int pitch, u_int period, u_int volume, int poll) auio.uio_rw = UIO_WRITE; UIO_SETUP_SYSSPACE(&auio); - audiobellwrite(fp, NULL, &auio, NULL, 0); + if (audiobellwrite(fp, NULL, &auio, NULL, 0) != 0) + break; len -= size; } out: