unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Po Lu <luangruo@yahoo.com>
Cc: emacs-devel@gnu.org
Subject: Re: master 691015fedb: Fix filelock.c for Haiku
Date: Sun, 09 Jan 2022 19:10:27 +0200	[thread overview]
Message-ID: <83pmp0al8c.fsf@gnu.org> (raw)

> 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?
Do we perhaps want to add an assertion to that effect?

Btw, what kind of errno values does Haiku use? what do you see in the
errno.h header there? are all the values negative?



             reply	other threads:[~2022-01-09 17:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-09 17:10 Eli Zaretskii [this message]
2022-01-10  0:08 ` master 691015fedb: Fix filelock.c for Haiku Po Lu

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=83pmp0al8c.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=luangruo@yahoo.com \
    /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).