]> granicus.if.org Git - nethack/commitdiff
Handle the case where we continue after locking a nonexistent file
authorAlex Smith <ais523@nethack4.org>
Fri, 1 Sep 2017 17:49:43 +0000 (18:49 +0100)
committerAlex Smith <ais523@nethack4.org>
Fri, 1 Sep 2017 17:49:43 +0000 (18:49 +0100)
The previous version of this would lead to big warnings and
impossibles. This doesn't seem like a useful case, but it's still
better to have better warning messages just in case it does
happen.

src/files.c

index 92bb1059630d53413443ddae3f016089f8b89f73..01ad0569f767311522cc9c3be013ebedf9414bd3 100644 (file)
@@ -1675,6 +1675,7 @@ int retryct;
     if (lockfd == -1) {
         HUP raw_printf("Cannot open file %s. Is NetHack installed correctly?",
                        filename);
+        nesting--;
         return FALSE;
     }
     sflock.l_type = F_WRLCK;