From 58a1828f188506b5d03591cb5a7db24895f62fa8 Mon Sep 17 00:00:00 2001 From: "nethack.allison" Date: Mon, 2 Oct 2006 03:43:31 +0000 Subject: [PATCH] win32 The new runtime has parameter checking, and this one would cause NetHack pop up a dialog and die. --- src/files.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/files.c b/src/files.c index 75f276c98..457706c25 100644 --- a/src/files.c +++ b/src/files.c @@ -629,7 +629,8 @@ really_close() lftrack.nethack_thinks_it_is_open = FALSE; lftrack.fd = -1; lftrack.oflag = 0; - (void)_close(fd); + if (fd != -1) + (void)_close(fd); return; }