Subject: bin/7985: [PATCH] games/adventure/setup.c bug fix
To: None <gnats-bugs@gnats.netbsd.org>
From: Joseph Myers <jsm28@cam.ac.uk>
List: netbsd-bugs
Date: 07/14/1999 10:31:54
>Number:         7985
>Category:       bin
>Synopsis:       [PATCH] games/adventure/setup.c bug fix
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 14 10:05:00 1999
>Last-Modified:
>Originator:     Joseph S. Myers
>Organization:
Trinity College, University of Cambridge, UK
>Release:        NetBSD-current of 1999-06-28
>Environment:
[
System: Linux decomino 2.2.10 #1 Mon Jun 14 07:48:53 UTC 1999 i686 unknown
Architecture: i686
]
>Description:

Bug reports to merge fixes from the Linux port of the NetBSD games,
number 52 or so in a series.

games/adventure/setup.c fails to check for errors when writing its
output.  This means that, if the disk fills up at this point during a
build, it would nevertheless fail to return an error status.

>How-To-Repeat:

>Fix:

diff -ruN adventure/setup.c adventure+/setup.c
--- adventure/setup.c	Wed Feb 10 12:06:41 1999
+++ adventure+/setup.c	Wed Jul 14 15:33:39 1999
@@ -121,5 +121,8 @@
 	}
 	puts("\n\t0\n};");
 	fclose(infile);
+	fflush(stdout);
+	if (ferror(stdout))
+		err(1, "writing standard output");
 	exit(0);
 }

>Audit-Trail:
>Unformatted: