From 18bc92cb83fdf0f0472432fb7c30914a9cd4df01 Mon Sep 17 00:00:00 2001 From: midipix Date: Sun, 15 Mar 2015 21:08:54 -0400 Subject: libiberty: remove source files that either duplicate functionality already present in all modern libc implementations, or are incompatible with modern development environments, or both. --- libiberty/rename.c | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 libiberty/rename.c (limited to 'libiberty/rename.c') diff --git a/libiberty/rename.c b/libiberty/rename.c deleted file mode 100644 index ad342ffca..000000000 --- a/libiberty/rename.c +++ /dev/null @@ -1,36 +0,0 @@ -/* rename -- rename a file - This function is in the public domain. */ - -/* - -@deftypefn Supplemental int rename (const char *@var{old}, const char *@var{new}) - -Renames a file from @var{old} to @var{new}. If @var{new} already -exists, it is removed. - -@end deftypefn - -*/ - -#include "ansidecl.h" -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#include -#ifdef HAVE_UNISTD_H -#include -#endif - -int -rename (const char *zfrom, const char *zto) -{ - if (link (zfrom, zto) < 0) - { - if (errno != EEXIST) - return -1; - if (unlink (zto) < 0 - || link (zfrom, zto) < 0) - return -1; - } - return unlink (zfrom); -} -- cgit v1.2.3