summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2006-05-28 17:15:24 +0000
committerBob Beck <beck@cvs.openbsd.org>2006-05-28 17:15:24 +0000
commit5e4dc0921a9eff2e8cc4f3c24a54ddd30e6c1d4a (patch)
tree9c2034a3fcac26a18b069947387efc094ecbfc94 /sys
parent27a6ab4b40c4f1c08d9b201c2bf294bb84c7e809 (diff)
Add PCATCH to tsleep flags when a scsi command is waiting for an opening
or is waiting to be retried, abort it when a signal interrupts the tsleep(). This fixes what was commited in version 1.92 to work properly. ok krw@
Diffstat (limited to 'sys')
-rw-r--r--sys/scsi/scsi_base.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c
index 02bf832cdb3..a4ad3b362af 100644
--- a/sys/scsi/scsi_base.c
+++ b/sys/scsi/scsi_base.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsi_base.c,v 1.103 2006/05/13 18:11:03 krw Exp $ */
+/* $OpenBSD: scsi_base.c,v 1.104 2006/05/28 17:15:23 beck Exp $ */
/* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */
/*
@@ -118,7 +118,7 @@ scsi_get_xs(sc_link, flags)
return (NULL);
}
sc_link->flags |= SDEV_WAITING;
- if (tsleep(sc_link, PRIBIO, "getxs", 0)) {
+ if (tsleep(sc_link, PRIBIO|PCATCH, "getxs", 0)) {
/* Bail out on getting a signal. */
sc_link->flags &= ~SDEV_WAITING;
return (NULL);
@@ -954,10 +954,11 @@ scsi_delay(xs, seconds)
return (EIO);
}
- while (seconds-- > 0)
- if (tsleep(&lbolt, PRIBIO, "scbusy", 0))
+ while (seconds-- > 0) {
+ if (tsleep(&lbolt, PRIBIO|PCATCH, "scbusy", 0))
/* Signal == abort xs. */
return (EIO);
+ }
return (ERESTART);
}