summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authordgregor <dgregor@cvs.openbsd.org>1997-08-19 03:51:00 +0000
committerdgregor <dgregor@cvs.openbsd.org>1997-08-19 03:51:00 +0000
commit599df9fd248553258b52fbecede530fce78a0e62 (patch)
treedfbd08cb5d9e13c896a42cd308e07a507d287e31 /sys
parent47a6a60b2ec3ee9be4e0f2019af5e8ce24e2e808 (diff)
Back out part of revision 1.16 where the tape was unmounted in stclose on
a non-rewinding device. When the tape was re-opened again, st_mount_tape called st_load, which causes the tape to be rewound. The best way to fix this problem would be to not call st_load in st_mount_tape if the tape is already in the drive and has already been loaded. But, I haven't figured out a good, safe way to do that yet....
Diffstat (limited to 'sys')
-rw-r--r--sys/scsi/st.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/scsi/st.c b/sys/scsi/st.c
index 3bb8801e2df..20cecf254f1 100644
--- a/sys/scsi/st.c
+++ b/sys/scsi/st.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: st.c,v 1.17 1997/07/11 19:26:00 tholo Exp $ */
+/* $OpenBSD: st.c,v 1.18 1997/08/19 03:50:59 dgregor Exp $ */
/* $NetBSD: st.c,v 1.71 1997/02/21 23:03:49 thorpej Exp $ */
/*
@@ -592,7 +592,9 @@ stclose(dev, flags, mode, p)
st_unmount(st, EJECT, NOREWIND);
break;
case 1: /* no rewind */
- st_unmount(st, NOEJECT, NOREWIND);
+ /* leave mounted unless media seems to have been removed */
+ if (!(st->sc_link->flags & SDEV_MEDIA_LOADED))
+ st_unmount(st, NOEJECT, NOREWIND);
break;
case 2: /* rewind, eject */
st_unmount(st, EJECT, DOREWIND);