| 157 | already exist and -r is not specified. */ |
| 158 | |
| 159 | static int |
| 160 | atomic_link (char const *source, int destdir_fd, char const *dest_base) |
| 161 | { |
| 162 | return (symbolic_link |
| 163 | ? (relative ? -1 |
| 164 | : errnoize (symlinkat (source, destdir_fd, dest_base))) |
| 165 | : beware_hard_dir_link ? -1 |
| 166 | : errnoize (linkat (AT_FDCWD, source, destdir_fd, dest_base, |
| 167 | logical ? AT_SYMLINK_FOLLOW : 0))); |
| 168 | } |
| 169 | |
| 170 | /* Link SOURCE to a directory entry under DESTDIR_FD named DEST_BASE. |
| 171 | DEST is the full name of the destination, useful for diagnostics. |