[Toybox] [PATCH 1/2] rm: Check file existence with lstat() explicitly if "-f" is specified

Rob Landley rob at landley.net
Mon Feb 1 19:58:26 PST 2021


On 2/1/21 1:22 PM, Yi-Yo Chiang via Toybox wrote:
> -    // Files that already don't exist aren't errors for -f, so try a quick
> -    // unlink now to see if it succeeds or reports that it didn't exist.
> -    if (FLAG(f) && (!unlink(*s) || errno == ENOENT)) continue;
> +    // Files that already don't exist aren't errors for -f.
> +    // We explicitly use lstat() but not faccessat() because Android bionic
> +    // intentionally don't support AT_SYMLINK_NOFOLLOW.

Intentionally?

Is there backstory here?

Rob


More information about the Toybox mailing list