selftests/ftrace: Avoid unlink error on first run

On the first run, ftracetest tries to unlink a symlink that does not
exist.
Use rm -f to avoid the "No such file or directory" error.

Link: https://lore.kernel.org/r/20261014114839.6258-1-jaewon8868@gmail.com
Fixes: 7dc1e125f0 ("ftrace/selftests: Add softlink to latest log directory")
Signed-off-by: Jaewon Jung <jaewon8868@gmail.com>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
This commit is contained in:
Jaewon Jung 2026-10-14 20:48:25 +09:00 committed by Shuah Khan
parent 2bd817bd2e
commit 0abfa9ad5c

View File

@ -243,7 +243,7 @@ else
mkdir -p $LOG_DIR || errexit "Failed to make a log directory: $LOG_DIR"
date > $LOG_FILE
if [ "x-$LINK_PTR" != "x-" ]; then
unlink $LINK_PTR
rm -f $LINK_PTR
ln -fs $LOG_DATE $LINK_PTR
fi
fi