]> granicus.if.org Git - nethack/commitdiff
handheld lockfile left around fix (from <Someone>)
authornethack.allison <nethack.allison>
Sat, 25 Oct 2003 18:32:30 +0000 (18:32 +0000)
committernethack.allison <nethack.allison>
Sat, 25 Oct 2003 18:32:30 +0000 (18:32 +0000)
doc/fixes34.3
src/files.c

index be7db5dbe7288f68a6ad02d4c4210d41c450150a..13a7bedfe5b763adb80513889e49a9fbca5ff518 100644 (file)
@@ -102,6 +102,7 @@ Gnome: key values on unsigned char platform could fail to compare correctly
 Gnome: real extended command menu so all extended commands can be entered
 Gnome: ignore interrupts to avoid infinite loop in gnome library
 tty: avoid crash displaying quit inventory if inventory was already displayed
+winCE: ensure orphaned lockfile is always deleted on single-user handhelds
 
 
 General New Features
index 63f9d2f0ecc67d0c3a10f47fe4b1e5da2e93e4c8..2e8fb0fa2a39478bc527071c791ecd52e2617270 100644 (file)
@@ -1372,12 +1372,16 @@ int retryct;
 #define OPENFAILURE(fd) (fd < 0)
     lockptr = -1;
 # endif
-    while (retryct-- && OPENFAILURE(lockptr)) {
-# ifdef AMIGA
+    while (--retryct && OPENFAILURE(lockptr)) {
+# if defined(WIN32) && !defined(WIN_CE)
+       lockptr = sopen(lockname, O_RDWR|O_CREAT, SH_DENYRW, S_IWRITE);
+# else
        (void)DeleteFile(lockname); /* in case dead process was here first */
+#  ifdef AMIGA
        lockptr = Open(lockname,MODE_NEWFILE);
-# else
+#  else
        lockptr = open(lockname, O_RDWR|O_CREAT|O_EXCL, S_IWRITE);
+#  endif
 # endif
        if (OPENFAILURE(lockptr)) {
            raw_printf("Waiting for access to %s.  (%d retries left).",