From 9596fd8a770b172d36dab35336eed16ed90307ad Mon Sep 17 00:00:00 2001 From: cgd Date: Fri, 17 Jan 1997 20:03:53 +0000 Subject: [PATCH] only call the device close routine on a (fall-through) error if F_NODEV isn't set in the file flags for the file being opened. Pointed out by Matthias Drochner in PR 3122. (fix equivalent to the one he included, but stylistically different.) --- sys/lib/libsa/open.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/lib/libsa/open.c b/sys/lib/libsa/open.c index 1a95abd9daf3..6c3236d131a9 100644 --- a/sys/lib/libsa/open.c +++ b/sys/lib/libsa/open.c @@ -1,4 +1,4 @@ -/* $NetBSD: open.c,v 1.12 1996/09/30 16:01:21 ws Exp $ */ +/* $NetBSD: open.c,v 1.13 1997/01/17 20:03:53 cgd Exp $ */ /*- * Copyright (c) 1993 @@ -119,7 +119,8 @@ fnd: if (!error) error = ENOENT; - f->f_dev->dv_close(f); + if ((f->f_flags & F_NODEV) == 0) + f->f_dev->dv_close(f); err: f->f_flags = 0; errno = error;