From: Po Lu <luangruo@yahoo.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: master 691015fedb: Fix filelock.c for Haiku
Date: Mon, 10 Jan 2022 08:08:16 +0800 [thread overview]
Message-ID: <87a6g4sb9r.fsf@yahoo.com> (raw)
In-Reply-To: <83pmp0al8c.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 09 Jan 2022 19:10:27 +0200")
Eli Zaretskii <eliz@gnu.org> writes:
>> diff --git a/src/filelock.c b/src/filelock.c
>> index a213c2b3ca..8453f17cd4 100644
>> --- a/src/filelock.c
>> +++ b/src/filelock.c
>> @@ -608,7 +608,7 @@ lock_if_free (lock_info_type *clasher, char *lfname)
>> 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. */
>> }
>> @@ -616,7 +616,14 @@ lock_if_free (lock_info_type *clasher, char *lfname)
>> /* 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
>> }
>
> Is it guaranteed that no errno value on Haiku cam ever be -1 or -2?
Yes.
> Do we perhaps want to add an assertion to that effect?
I don't think that's necessary.
> Btw, what kind of errno values does Haiku use? what do you see in the
> errno.h header there? are all the values negative?
They're aliased to BeOS error codes, which are all negative by quite a
large value (INT_MIN + error_code).
prev parent reply other threads:[~2022-01-10 0:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-09 17:10 master 691015fedb: Fix filelock.c for Haiku Eli Zaretskii
2022-01-10 0:08 ` Po Lu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a6g4sb9r.fsf@yahoo.com \
--to=luangruo@yahoo.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).