]> granicus.if.org Git - nethack/commitdiff
win32
authornethack.allison <nethack.allison>
Mon, 2 Oct 2006 03:43:31 +0000 (03:43 +0000)
committernethack.allison <nethack.allison>
Mon, 2 Oct 2006 03:43:31 +0000 (03:43 +0000)
The new runtime has parameter checking, and this one
would cause NetHack pop up a dialog and die.

src/files.c

index 75f276c983f840188799e915377395950eff49c1..457706c25dd721cd09c8696b36bd631654ab7c50 100644 (file)
@@ -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;
 }