From 6e34b79e01e4f8c6dfee0fcee4ac6a622f64e669 Mon Sep 17 00:00:00 2001 From: mjacob Date: Fri, 31 Jul 1998 17:25:55 +0000 Subject: [PATCH] Suggestion from Matthias Drochner: If at close you decide to write filemark 'coz you opened write only and didn't do anything else, call st_check_eod to possibly write TWO furshlugginer filemarks. Also- return any errors from writing filemarks out of stclose. --- sys/dev/scsipi/st.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/scsipi/st.c b/sys/dev/scsipi/st.c index bde4e4697c57..42430979ba10 100644 --- a/sys/dev/scsipi/st.c +++ b/sys/dev/scsipi/st.c @@ -1,4 +1,4 @@ -/* $NetBSD: st.c,v 1.96 1998/07/31 04:00:22 mjacob Exp $ */ +/* $NetBSD: st.c,v 1.97 1998/07/31 17:25:55 mjacob Exp $ */ /* * Copyright (c) 1994 Charles Hannum. All rights reserved. @@ -637,7 +637,7 @@ stclose(dev, flags, mode, p) int mode; struct proc *p; { - int stxx; + int stxx, error = 0; struct st_softc *st = st_cd.cd_devs[STUNIT(dev)]; SC_DEBUG(st->sc_link, SDEV_DB1, ("closing\n")); @@ -659,7 +659,7 @@ stclose(dev, flags, mode, p) stxx = st->flags & (ST_WRITTEN | ST_FM_WRITTEN); if (stxx == ST_WRITTEN || ((flags & O_ACCMODE) == FWRITE && stxx == 0)) - st_write_filemarks(st, 1, 0); + error = st_check_eod(st, FALSE, &stxx, 0); /* recycling stxx */ switch (STMODE(dev)) { case NORMAL_MODE: st_unmount(st, NOEJECT); @@ -676,7 +676,7 @@ stclose(dev, flags, mode, p) } st->sc_link->flags &= ~SDEV_OPEN; - return (0); + return (error); } /*