NetBSD Problem Report #8016
Received: (qmail 15031 invoked from network); 17 Jul 1999 09:30:36 -0000
Message-Id: <E115QP7-00004d-00@decomino.localnet>
Date: Sat, 17 Jul 1999 09:05:09 +0000
From: Joseph Myers <jsm28@cam.ac.uk>
Reply-To: Joseph Myers <jsm28@cam.ac.uk>
To: gnats-bugs@gnats.netbsd.org
Cc: Joseph Myers <jsm28@cam.ac.uk>
Subject: [PATCH] Adventure saved file handling
X-Send-Pr-Version: 3.95
>Number: 8016
>Category: bin
>Synopsis: [PATCH] Adventure saved file handling
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Jul 17 02:35:02 +0000 1999
>Closed-Date: Sat Jul 17 20:07:11 +0000 1999
>Last-Modified: Sat Jul 17 20:08:20 +0000 1999
>Originator: Joseph S. Myers
>Release: NetBSD-current of 1999-07-16
>Organization:
Trinity College, University of Cambridge, UK
>Environment:
[
System: Linux decomino 2.2.10 #1 Mon Jun 14 07:48:53 UTC 1999 i686 unknown
Architecture: i686
]
>Description:
Adventure(6) should check for errors (e.g. disk full or quota
exceeded) when writing out saved games.
>How-To-Repeat:
>Fix:
diff -ruN adventure/save.c adventure+/save.c
--- adventure/save.c Fri Jul 16 11:02:52 1999
+++ adventure+/save.c Fri Jul 16 21:41:49 1999
@@ -47,6 +47,7 @@
#endif
#endif /* not lint */
+#include <err.h>
#include <stdio.h>
#include <stdlib.h>
#include "hdr.h"
@@ -152,7 +153,10 @@
*s = (*s ^ random()) & 0xFF; /* Lightly encrypt */
fwrite(p->address, p->width, 1, out);
}
- fclose(out);
+ if (fclose(out) != 0) {
+ warn("writing %s", outfile);
+ return 1;
+ }
return 0;
}
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: hubertf
State-Changed-When: Sat Jul 17 13:07:11 PDT 1999
State-Changed-Why:
Patch applied, thanks!
- Hubert
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.