Now that we have linkat(2), we support to the ability to hardlink to symlinks. POSIX specifies that pax do that when the input file specifies it, so let's do it.
oks? Philip Index: file_subs.c =================================================================== RCS file: /cvs/src/bin/pax/file_subs.c,v retrieving revision 1.33 diff -u -p -r1.33 file_subs.c --- file_subs.c 16 Apr 2013 18:06:35 -0000 1.33 +++ file_subs.c 7 Oct 2013 02:27:39 -0000 @@ -307,7 +307,7 @@ mk_link(char *to, struct stat *to_sb, ch * try again) */ for (;;) { - if (link(to, from) == 0) + if (linkat(AT_FDCWD, to, AT_FDCWD, from, 0) == 0) break; oerrno = errno; if (!nodirs && chk_path(from, to_sb->st_uid, to_sb->st_gid) == 0)