]> granicus.if.org Git - recode/commitdiff
main.c: assume we have rename(3) as it’s standard since C89
authorReuben Thomas <rrt@sc3d.org>
Tue, 16 Jan 2018 00:11:25 +0000 (00:11 +0000)
committerReuben Thomas <rrt@sc3d.org>
Fri, 19 Jan 2018 00:19:36 +0000 (00:19 +0000)
In fact, since my recent changes, HAVE_RENAME was not being defined, so
rename was not used!

src/main.c

index b16172643fa5e11b2f3bebafb65288533b14b4ad..9a264c7e96e033653c1534f34f29027afca64f61 100644 (file)
@@ -882,17 +882,9 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"),
 
                  if (chmod (output_name, file_stat.st_mode & 07777) < 0)
                    error (EXIT_FAILURE, errno, "chmod (%s)", output_name);
-#if HAVE_RENAME
                  if (rename (output_name, input_name) < 0)
                    error (EXIT_FAILURE, errno, "rename (%s, %s)",
                           output_name, input_name);
-#else
-                 if (link (output_name, input_name) < 0)
-                   error (EXIT_FAILURE, errno, "link (%s, %s)",
-                          output_name, input_name);
-                 if (unlink (output_name) < 0)
-                   error (EXIT_FAILURE, errno, "unlink (%s)", output_name);
-#endif
 
                  /* Adjust the time stamp for the new file.  */