Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/checknr Only fclose file if it is open. From Tim Rob...



details:   https://anonhg.NetBSD.org/src/rev/1d30dbca4ba6
branches:  trunk
changeset: 546936:1d30dbca4ba6
user:      wiz <wiz%NetBSD.org@localhost>
date:      Fri May 09 08:44:57 2003 +0000

description:
Only fclose file if it is open. From Tim Robbins (tjr@freebsd).

diffstat:

 usr.bin/checknr/checknr.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (31 lines):

diff -r 84fc5f84a251 -r 1d30dbca4ba6 usr.bin/checknr/checknr.c
--- a/usr.bin/checknr/checknr.c Fri May 09 08:20:27 2003 +0000
+++ b/usr.bin/checknr/checknr.c Fri May 09 08:44:57 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: checknr.c,v 1.10 2002/01/21 18:28:00 wiz Exp $ */
+/*     $NetBSD: checknr.c,v 1.11 2003/05/09 08:44:57 wiz Exp $ */
 
 /*
  * Copyright (c) 1980, 1993
@@ -43,7 +43,7 @@
 #if 0
 static char sccsid[] = "@(#)checknr.c  8.1 (Berkeley) 6/6/93";
 #else 
-__RCSID("$NetBSD: checknr.c,v 1.10 2002/01/21 18:28:00 wiz Exp $");
+__RCSID("$NetBSD: checknr.c,v 1.11 2003/05/09 08:44:57 wiz Exp $");
 #endif
 #endif /* not lint */
 
@@ -285,9 +285,10 @@
                        f = fopen(cfilename, "r");
                        if (f == NULL)
                                perror(cfilename);
-                       else
+                       else {
                                process(f);
-                       fclose(f);
+                               fclose(f);
+                       }
                }
        } else {
                cfilename = "stdin";



Home | Main Index | Thread Index | Old Index