>From 3e0dff3925b5e521cae468087950e85b60002d1c Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 17 Mar 2019 13:20:42 -0700 Subject: [PATCH] ln: port to symlink ("x", ".") failing with EINVAL 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ln.c b/src/ln.c index a5b012b39..646ca3d4d 100644 --- 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]; -- 2.17.1