From 4a7c9490fe838327574fc88f94365f90cce56c55 Mon Sep 17 00:00:00 2001 From: cohrs Date: Thu, 13 Jan 2005 01:36:40 +0000 Subject: [PATCH] startup problems on Unix I found I was no longer able to start "nethack", I think due to the change in the save file structure. But, it looks like the Unix-specific check in bufon() was never quite correct. I'd have to guess we've been lucky up until now. --- src/save.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/save.c b/src/save.c index 62d2325ef..a5519b807 100644 --- a/src/save.c +++ b/src/save.c @@ -723,11 +723,13 @@ bufon(fd) int fd; { #ifdef UNIX - if(bw_fd >= 0) - panic("double buffering unexpected"); - bw_fd = fd; - if((bw_FILE = fdopen(fd, "w")) == 0) - panic("buffering of file %d failed", fd); + if(bw_fd != fd) { + if(bw_fd >= 0) + panic("double buffering unexpected"); + bw_fd = fd; + if((bw_FILE = fdopen(fd, "w")) == 0) + panic("buffering of file %d failed", fd); + } #endif buffering = TRUE; } -- 2.40.0