]> git.eshelyaron.com Git - emacs.git/commit
Clean up filelock code related to errno
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 11 Jan 2022 16:58:18 +0000 (08:58 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 11 Jan 2022 16:58:39 +0000 (08:58 -0800)
commita980795fd0bd2ae5fb0dba27fafbb811bc2ff75d
tree875f7b4859be26f4f5dd70655b2cba8c777cdcfe
parent68f2d772e51a0f436559bbfe26868eaca23af390
Clean up filelock code related to errno

Reduce dependency on Haiku internals, by not assuming that
Haiku errno values (which are negative) are neither -1 nor -2.
This removes an #ifdef HAIKU while still maintaining
portability to Haiku.
* src/filelock.c (NEGATIVE_ERRNO, ANOTHER_OWNS_IT, I_OWN_IT):
New constants, which should work regardless of whether
we are on Haiku or B_USE_POSITIVE_POSIX_ERRORS is defined.
(current_lock_owner, lock_if_free, lock_file, unlock_file)
(Ffile_locked_p): Use them, without assuming anything about errno
value sign.
src/filelock.c