VS 2013 build of NetHack.exe and also fix level file locking

This commit is contained in:
nhmall
2015-02-28 00:37:05 -05:00
parent 528e8b34e0
commit 796f6f85d0
14 changed files with 507 additions and 217 deletions
+1 -1
View File
@@ -402,7 +402,7 @@ char *argv[];
hackpid = 1;
#endif
write(fd, (genericptr_t) &hackpid, sizeof(hackpid));
close(fd);
nhclose(fd);
}
#ifdef MFLOPPY
level_info[0].where = ACTIVE;
+2 -2
View File
@@ -282,7 +282,7 @@ int start;
if (sysflags.asksavedisk) {
/* Don't prompt if you can find the save file */
if ((fd = open_savefile()) >= 0) {
(void) close(fd);
(void) nhclose(fd);
return 1;
}
clear_nhwindow(WIN_MESSAGE);
@@ -335,7 +335,7 @@ comspec_exists()
if ((comspec = getcomspec()))
if ((fd = open(comspec, O_RDONLY)) >= 0) {
(void) close(fd);
(void) nhclose(fd);
return TRUE;
}
return FALSE;
+2 -2
View File
@@ -150,7 +150,7 @@ getlock()
error("Cannot open %s", fq_lock);
}
(void) close(fd);
(void) nhclose(fd);
if(iflags.window_inited) {
# ifdef SELF_RECOVER
@@ -248,7 +248,7 @@ gotlock:
# endif
error("cannot write lock (%s)", fq_lock);
}
if(close(fd) == -1) {
if(nhclose(fd) == -1) {
# if defined(CHDIR) && !defined(NOCWD_ASSUMPTIONS)
chdirx(orgdir, 0);
# endif