emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MinGW build on master fails with Error 127


From: Eli Zaretskii
Subject: Re: MinGW build on master fails with Error 127
Date: Sat, 24 Dec 2022 21:27:01 +0200

> From: Óscar Fuentes <ofv@wanadoo.es>
> Cc: emacs-devel@gnu.org
> Date: Sat, 24 Dec 2022 20:19:24 +0100
> 
> Óscar Fuentes <ofv@wanadoo.es> writes:
> 
> >>> The commit message says "fclose fail during atexit as if they were
> >>> already closed" but indeed it doesn't describe a user-visible problem. I
> >>> can ask for more details, if you are interested.
> >>
> >> I am.
> >
> > Ok, I'll ask the patch author.
> 
> This is his answer:
> 
>   Afair it showed an error at exit and exited != 0.

Here's the source code of close_stream (after I removed the comments):

  int
  close_stream (FILE *stream)
  {
    const bool some_pending = (__fpending (stream) != 0);
    const bool prev_fail = (ferror (stream) != 0);
    const bool fclose_fail = (fclose (stream) != 0);

    if (prev_fail || (fclose_fail && (some_pending || errno != EBADF)))
      {
        if (! fclose_fail)
          errno = 0;
        return EOF;
      }

    return 0;
  }

My questions are simple: which of the conditions for the error return
actually happened?  And what was the value of 'errno' (the code only
filters out EBADF)?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]