fileio.c (Frename_file): Put symlink handling inside #ifdef S_IFLNK.
authorJan Djärv <jan.h.d@swipnet.se>
Tue, 4 May 2004 19:23:31 +0000 (19:23 +0000)
committerJan Djärv <jan.h.d@swipnet.se>
Tue, 4 May 2004 19:23:31 +0000 (19:23 +0000)
src/ChangeLog
src/fileio.c

index 9ff41a4..035aa78 100644 (file)
@@ -2,6 +2,7 @@
 
        * fileio.c (barf_or_query_if_file_exists): Use lstat.
        (Frename_file): Handle renaming of symlinks across file systems.
+       (Frename_file): Put symlink handling inside #ifdef S_IFLNK.
 
 2004-05-04  Kim F. Storm  <storm@cua.dk>
 
index 04068e2..7d20697 100644 (file)
@@ -2725,15 +2725,17 @@ This is what happens in interactive use with M-x.  */)
     {
       if (errno == EXDEV)
        {
+#ifdef S_IFLNK
           symlink_target = Ffile_symlink_p (file);
-          if (NILP (symlink_target))
+          if (! NILP (symlink_target))
+            Fmake_symbolic_link (symlink_target, newname,
+                                 NILP (ok_if_already_exists) ? Qnil : Qt, Qt);
+          else
+#endif
             Fcopy_file (file, newname,
                         /* We have already prompted if it was an integer,
                            so don't have copy-file prompt again.  */
                         NILP (ok_if_already_exists) ? Qnil : Qt, Qt);
-          else
-            Fmake_symbolic_link (symlink_target, newname,
-                                 NILP (ok_if_already_exists) ? Qnil : Qt, Qt);
          Fdelete_file (file);
        }
       else