-/* $NetBSD: dumpgame.c,v 1.5 1997/10/12 21:24:42 christos Exp $ */
+/* $NetBSD: dumpgame.c,v 1.11 2007/12/15 19:44:44 perry Exp $ */
/*
* Copyright (c) 1980, 1993
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
#if 0
static char sccsid[] = "@(#)dumpgame.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: dumpgame.c,v 1.5 1997/10/12 21:24:42 christos Exp $");
+__RCSID("$NetBSD: dumpgame.c,v 1.11 2007/12/15 19:44:44 perry Exp $");
#endif
#endif /* not lint */
int count;
};
-static int readdump __P((int));
+static int readdump(int);
struct dump Dump_template[] =
/*ARGSUSED*/
void
dumpgame(v)
- int v;
+ int v __unused;
{
int version;
int fd;
int fd;
int version;
- if ((fd = open("trek.dump", 0)) < 0 ||
+ if ((fd = open("trek.dump", O_RDONLY)) < 0 ||
read(fd, &version, sizeof version) != sizeof version ||
version != VERSION ||
readdump(fd))
{
printf("cannot restart\n");
- close(fd);
+ if (fd >= 0)
+ close(fd);
return (1);
}