+ /* 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 (errno != ENOENT)
+ return -1;
+ }
+ else
+ {
+ if ((from_stats.st_dev == to_stats.st_dev)
+ && (from_stats.st_ino == to_stats.st_dev))
+ /* `from' and `to' designate the same file on that filesystem. */
+ return 0;
+
+ if (unlink (to) && errno != ENOENT)
+ return -1;
+ }