From 57054ddd444bd1702f2bcc08321d3ed3a644448e Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 10 Jul 2012 23:09:09 -0700 Subject: [PATCH] Assume rename. --- ChangeLog | 4 ++-- admin/CPP-DEFINES | 1 - admin/ChangeLog | 5 +++-- configure.ac | 2 +- src/ChangeLog | 3 +++ src/sysdep.c | 23 ----------------------- 6 files changed, 9 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index 85c43dd93ee..53259731ebf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,7 @@ 2012-07-11 Paul Eggert - Assume strerror. - * configure.ac (strerror): Remove check. + Assume rename, strerror. + * configure.ac (rename, strerror): Remove check. 2012-07-11 Glenn Morris diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES index f5522a77ccb..7f4aa699895 100644 --- a/admin/CPP-DEFINES +++ b/admin/CPP-DEFINES @@ -137,7 +137,6 @@ HAVE_MOUSE HAVE_PSTAT_GETDYNAMIC HAVE_PWD_H HAVE_RANDOM -HAVE_RENAME HAVE_RES_INIT HAVE_RINT HAVE_RMDIR diff --git a/admin/ChangeLog b/admin/ChangeLog index fd03be5bd8c..c139e99f609 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,7 +1,8 @@ 2012-07-11 Paul Eggert - Assume perror, strerror. - * CPP-DEFINES (HAVE_PERROR, HAVE_STRERROR, strerror): Remove. + Assume perror, rename, strerror. + * CPP-DEFINES (HAVE_PERROR, HAVE_RENAME, HAVE_STRERROR, strerror): + Remove. 2012-07-10 Dmitry Antipov diff --git a/configure.ac b/configure.ac index 2162e1bbd0d..ddb25534257 100644 --- a/configure.ac +++ b/configure.ac @@ -2708,7 +2708,7 @@ AC_SUBST(BLESSMAIL_TARGET) AC_CHECK_FUNCS(gethostname \ -rename closedir mkdir rmdir getrusage get_current_dir_name \ +closedir mkdir rmdir getrusage get_current_dir_name \ lrand48 logb frexp fmod cbrt setsid \ fpathconf select euidaccess getpagesize setlocale \ utimes getrlimit setrlimit setpgid getcwd shutdown getaddrinfo \ diff --git a/src/ChangeLog b/src/ChangeLog index 749bc12328c..7b47636969e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2012-07-11 Paul Eggert + Assume rename. + * sysdep.c (rename) [!HAVE_RENAME]: Remove. + Assume perror. * s/hpux10-20.h (HAVE_PERROR): Remove. * sysdep.c (perror) [HPUX && !HAVE_PERROR]: diff --git a/src/sysdep.c b/src/sysdep.c index 4bbe939dd74..274e000e9f3 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -2000,29 +2000,6 @@ getwd (char *pathname) #endif /* HAVE_GETWD */ -/* - * Emulate rename using unlink/link. Note that this is - * only partially correct. Also, doesn't enforce restriction - * that files be of same type (regular->regular, dir->dir, etc). - */ - -#ifndef HAVE_RENAME - -int -rename (const char *from, const char *to) -{ - if (access (from, 0) == 0) - { - unlink (to); - if (link (from, to) == 0) - if (unlink (from) == 0) - return (0); - } - return (-1); -} - -#endif - /* * This function will go away as soon as all the stubs fixed. (fnf) */ -- 2.39.2