Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/lib/libsa Make the check in close() for a non-deflatable...



details:   https://anonhg.NetBSD.org/src/rev/b68c4a7b901f
branches:  trunk
changeset: 786093:b68c4a7b901f
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Apr 14 22:23:28 2013 +0000

description:
Make the check in close() for a non-deflatable file mode symetric to
the one in open().
Avoids dealloc() calls on NULL.

diffstat:

 sys/lib/libsa/cread.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 748a0132d8a2 -r b68c4a7b901f sys/lib/libsa/cread.c
--- a/sys/lib/libsa/cread.c     Sun Apr 14 20:18:17 2013 +0000
+++ b/sys/lib/libsa/cread.c     Sun Apr 14 22:23:28 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cread.c,v 1.23 2009/03/25 18:41:06 tls Exp $   */
+/*     $NetBSD: cread.c,v 1.24 2013/04/14 22:23:28 martin Exp $        */
 
 /*
  * Copyright (c) 1996
@@ -302,7 +302,7 @@
 #endif
        f = &files[fd];
 
-       if ((f->f_flags & F_READ) == 0)
+       if ((f->f_flags & (F_READ|F_WRITE)) == F_READ)
                return oclose(fd);
 
        s = ss[fd];



Home | Main Index | Thread Index | Old Index