Skip to contentSkip to conversation

selftests/ftrace: Avoid unlink error on first run

PATCH In review Jaewon Jung 3 participants 3 messages Oct 14

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

Fixes 7dc1e125f07a ("ftrace/selftests: Add softlink to latest log directory")
---
 tools/testing/selftests/ftrace/ftracetest | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/ftrace/ftracetest +1 -1
index 246d7e1d015c..95804610e079 100755
@@ -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
Signature · 1 line
2.43.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Jaewon Jung

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.

Fixes 7dc1e125f07a ("ftrace/selftests: Add softlink to latest log directory")

Looks good to me.

Shuah, will you pick this?

Thank you,

Quoted 20 lines
---
 tools/testing/selftests/ftrace/ftracetest | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/ftrace/ftracetest +1 -1
index 246d7e1d015c..95804610e079 100755
@@ -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
Signature · 1 line
2.43.0
Signature · 1 line
Masami Hiramatsu (Google) <[email protected]>
maintainer
#2 lore raw
Quoted 5 lines · Masami Hiramatsu (Google)
Quoted 4 lines · Jaewon Jung

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.

Quoted 8 lines
Quoted 2 lines
Fixes 7dc1e125f07a ("ftrace/selftests: Add softlink to latest log directory")

Looks good to me.

Shuah, will you pick this?

Done.

thanks,
-- Shuah