Jinoh Kang (@iamahuman) commented about server/fd.c:
- {
sprintf( tmpname, tmpname_fmt, tmp_value );if (fstatat( dirfd, tmpname, &st, 0 )) /* tmpname doesn't exist */break;- }
- if (i < 0x8000)
- {
if (renameat( dirfd, srcname, dirfd, tmpname )){file_set_error();goto ret;}if (!is_dir){if (linkat( dirfd, tmpname, dirfd, dstname, 0 ) && errno != EEXIST)
To avoid bikesheds, maybe add a comment before this line:
```suggestion:-0+0 /* we can't just do rename(2) here; renaming a file to its hardlink is no-op */ if (linkat( dirfd, tmpname, dirfd, dstname, 0 ) && errno != EEXIST) ```