texinfo-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Gavin D. Smith
Date: Fri, 18 Aug 2023 05:45:34 -0400 (EDT)

branch: master
commit a2972df0af51f8461611b634e44629e84d0f0f29
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Fri Aug 18 10:31:53 2023 +0100

    * install-info/install-info.c (output_dirfile):
    In case removing and renaming to target dirfile failed, print
    error message and exit with pfatal_with_name function.  Lack
    of exit reported by Bruno Haible.
---
 ChangeLog                   | 7 +++++++
 install-info/install-info.c | 9 ++-------
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 27a924707e..7ac04fab84 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2023-08-18  Gavin Smith <gavinsmith0123@gmail.com>
+
+       * install-info/install-info.c (output_dirfile):
+       In case removing and renaming to target dirfile failed, print
+       error message and exit with pfatal_with_name function.  Lack
+       of exit reported by Bruno Haible.
+
 2023-08-16  Gavin Smith <gavinsmith0123@gmail.com>
 
        pretest 7.0.90
diff --git a/install-info/install-info.c b/install-info/install-info.c
index d9d7793219..3aab38dfe6 100644
--- a/install-info/install-info.c
+++ b/install-info/install-info.c
@@ -1072,15 +1072,10 @@ output_dirfile (char *dirfile, int dir_nlines, struct 
line_data *dir_lines,
     {
       /* Try to delete target file and try again.  On some platforms you
          may not rename to an existing file. */
-      if (remove (dirfile) == -1)
+      if (remove (dirfile) == -1 || rename (tempname, dirfile) == -1)
         {
-          perror (dirfile);
-          remove (tempname);
-        }
-      else if (rename (tempname, dirfile) == -1)
-        {
-          perror (tempname);
           remove (tempname);
+          pfatal_with_name (dirfile);
         }
     }
 }



reply via email to

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