It's not portable; see <http://bugs.gnu.org/11108#17>.
* src/chmod.c, NEWS: Undo previous change.
* Noteworthy changes in release ?.? (????-??-??) [?]
-** Bug fixes
-
- When recursing, chmod -R no longer gets confused into following a symlink
- if some other process simultaneously replaces a non-symlink with a symlink.
- The fix is effective on modern hosts with the fchmodat or lchmod syscalls.
- [bug introduced in the beginning]
* Noteworthy changes in release 8.16 (2012-03-26) [stable]
if (! S_ISLNK (old_mode))
{
- /* Use any native support for AT_SYMLINK_NOFOLLOW, to avoid
- following a symlink if there is a race. */
- #if HAVE_FCHMODAT || HAVE_LCHMOD
- int follow_flag = AT_SYMLINK_NOFOLLOW;
- #else
- int follow_flag = 0;
- #endif
-
- if (fchmodat (fts->fts_cwd_fd, file, new_mode, follow_flag) == 0)
+ if (chmodat (fts->fts_cwd_fd, file, new_mode) == 0)
chmod_succeeded = true;
else
{