From 37a466b452701a1a2af355a21e8205f8a41c1fb8 Mon Sep 17 00:00:00 2001 From: ps Date: Fri, 16 Sep 2005 18:04:10 +0000 Subject: [PATCH] MFC: rev 1.66 Don't allow ioctl commands to be interrupted by the user. Approved by: re (scottl) --- sys/dev/amr/amr.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sys/dev/amr/amr.c b/sys/dev/amr/amr.c index 350d11a971cd..0f9c4e360c1c 100644 --- a/sys/dev/amr/amr.c +++ b/sys/dev/amr/amr.c @@ -962,7 +962,7 @@ amr_bio_command(struct amr_softc *sc, struct amr_command **acp) static int amr_wait_command(struct amr_command *ac) { - int error, count; + int error = 0; debug_called(1); @@ -971,12 +971,10 @@ amr_wait_command(struct amr_command *ac) if ((error = amr_start(ac)) != 0) return(error); - count = 0; - /* XXX better timeout? */ - while ((ac->ac_flags & AMR_CMD_BUSY) && (count < 30)) { - msleep(ac, &ac->ac_sc->amr_io_lock, PRIBIO | PCATCH, "amrwcmd", hz); + while ((ac->ac_flags & AMR_CMD_BUSY) && (error != EWOULDBLOCK)) { + error = msleep(ac, &ac->ac_sc->amr_io_lock, PRIBIO, "amrwcmd", 0); } - return(0); + return(error); } /********************************************************************************