On Dez 03 2022, Gavin Smith wrote:

> I've done this:
>
> --- a/install-info/install-info.c
> +++ b/install-info/install-info.c
> @@ -1054,7 +1054,20 @@ output_dirfile (char *dirfile, int dir_nlines, struct 
> line_data *dir_lines,
>    /* Update dir file atomically.  This stops the dir file being corrupted
>       if install-info is interrupted. */
>    if (rename (tempname, dirfile) == -1)
> -    perror (tempname);
> +    {
> +      /* Try to delete target file and try again.  On some platforms you
> +         may not rename to an existing file. */
> +      if (remove (dirfile) == -1)

I think the remove failure should be ignored.  If rename fails for other
reasons than an existing destination, this may lose the original failure
condition from rename, reporting a confusing and unrelated error.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

Reply via email to