]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix lock files on some versions of Cygwin
authorEli Zaretskii <eliz@gnu.org>
Sun, 5 May 2024 16:30:57 +0000 (19:30 +0300)
committerEshel Yaron <me@eshelyaron.com>
Mon, 6 May 2024 16:55:39 +0000 (18:55 +0200)
* src/filelock.c (current_lock_owner): Support negative boot-time
on rare systems.  (Bug#70415)

(cherry picked from commit d5b6627faa9bbd0059600a91d1cd45c0b31e3cd8)

src/filelock.c

index 01d35c46726a42fc69d666f1c68151d31c88afa3..e5b352cb6ff789432676ad7a06ef4d9a3c71e435 100644 (file)
@@ -419,7 +419,9 @@ current_lock_owner (lock_info_type *owner, Lisp_Object lfname)
       boot += 2;
       FALLTHROUGH;
     case ':':
-      if (! c_isdigit (boot[0]))
+      if (!(c_isdigit (boot[0])
+           /* A negative number.  */
+           || (boot[0] == '-' && c_isdigit (boot[1]))))
        return EINVAL;
       boot_time = strtoimax (boot, &lfinfo_end, 10);
       break;