]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
ln: port to symlink ("x", ".") failing with EINVAL
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 17 Mar 2019 20:20:42 +0000 (13:20 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 17 Mar 2019 20:22:32 +0000 (13:22 -0700)
Problem reported by John Marino (Bug#34894).
* src/ln.c (main): Port ln -s to Solaris symlink function,
where symlink ("x", ".") fails with errno == EINVAL.

src/ln.c

index a5b012b39a03088f1d4d0d01f8644bf8e3ee9dc9..646ca3d4d26db32998a27a7f5a32eac9cc1798ca 100644 (file)
--- a/src/ln.c
+++ b/src/ln.c
@@ -603,7 +603,8 @@ main (int argc, char **argv)
     {
       if (n_files == 2 && !target_directory)
         link_errno = atomic_link (file[0], AT_FDCWD, file[1]);
-      if (link_errno < 0 || link_errno == EEXIST || link_errno == ENOTDIR)
+      if (link_errno < 0 || link_errno == EEXIST || link_errno == ENOTDIR
+         || link_errno == EINVAL)
         {
           char const *d
             = target_directory ? target_directory : file[n_files - 1];