changeset 20121:a0ec137a661b

(rename): Use stat, not safe_stat. (rename): Compare src and dest inode numbers rather than src inode and dest *dev* when determining whether src and dest refer to the same file. From marc@math.cornell.edu (Marc Parmet).
author Jim Meyering <jim@meyering.net>
date Sat, 13 May 1995 13:19:07 +0000
parents 50b44aa48608
children d390c810abd9
files lib/rename.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lib/rename.c	Sat May 13 13:13:04 1995 +0000
+++ b/lib/rename.c	Sat May 13 13:19:07 1995 +0000
@@ -47,13 +47,13 @@
   struct stat from_stats, to_stats;
   int pid, status;
 
-  if (safe_stat (from, &from_stats))
+  if (stat (from, &from_stats))
     return -1;
 
   /* Be careful not to unlink `from' if it happens to be equal to `to' or
      (on filesystems that silently truncate filenames after 14 characters)
      if `from' and `to' share the significant characters. */
-  if (safe_stat (to, &to_stats))
+  if (stat (to, &to_stats))
     {
       if (errno != ENOENT)
         return -1;
@@ -61,7 +61,7 @@
   else
     {
       if ((from_stats.st_dev == to_stats.st_dev)
-          && (from_stats.st_ino == to_stats.st_dev))
+          && (from_stats.st_ino == to_stats.st_ino))
         /* `from' and `to' designate the same file on that filesystem. */
         return 0;