This was found during the investigation surrounding bug#53136,
but is not directly related.
* src/filelock.c (lock_if_free): Explictly test err against -1
or -2, and reverse sign of system errors on Haiku. (No Haiku
error occupies -1 or -2.)
err = current_lock_owner (clasher, lfname);
if (err != 0)
{
- if (err < 0)
+ if (err == -1 || err == -2)
return -2 - err; /* We locked it, or someone else has it. */
break; /* current_lock_owner returned strange error. */
}
/* We deleted a stale lock; try again to lock the file. */
}
+#if !defined HAIKU \
+ || defined BE_USE_POSITIVE_POSIX_ERRORS
return err;
+#else
+ /* On Haiku, POSIX error values are negative by default, but this
+ code's callers assume that any errno value is positive. */
+ return -err;
+#endif
}
static Lisp_Object