mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2026-03-14 14:59:45 +01:00
base-files: avoid rm error messages in failsafe_wait
The fs_wait_for_key function runs multiple background processes that all try to delete the same temporary file ($keypress_wait) when they exit. This creates a race condition where one process successfully deletes the file while others fail with ENOENT. Busybox rm only suppresses "file not found" errors during the initial lstat() check, not during the actual unlink() call. This causes error messages in the boot log even with rm -f: rm: can't remove '/tmp/tmp.hKjPDH': No such file or directory Fixed by redirecting stderr to /dev/null for rm calls in concurrent contexts. This change does not affect functionality and only avoids confusing log output during boot. Signed-off-by: Oliver Sedlbauer <os@dev.tdt.de> Link: https://github.com/openwrt/openwrt/pull/22079 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This commit is contained in:
parent
a75cc4f18c
commit
49a0acb12c
1 changed files with 4 additions and 4 deletions
|
|
@ -21,8 +21,8 @@ fs_wait_for_key () {
|
|||
touch $keypress_sec
|
||||
fi
|
||||
|
||||
trap "echo 'true' >$keypress_true; lock -u $keypress_wait ; rm -f $keypress_wait" INT
|
||||
trap "echo 'true' >$keypress_true; lock -u $keypress_wait ; rm -f $keypress_wait" USR1
|
||||
trap "echo 'true' >$keypress_true; lock -u $keypress_wait ; rm -f $keypress_wait 2>/dev/null" INT
|
||||
trap "echo 'true' >$keypress_true; lock -u $keypress_wait ; rm -f $keypress_wait 2>/dev/null" USR1
|
||||
|
||||
[ -n "$timeout" ] || timeout=1
|
||||
[ $timeout -ge 1 ] || timeout=1
|
||||
|
|
@ -37,7 +37,7 @@ fs_wait_for_key () {
|
|||
sleep 1
|
||||
done
|
||||
lock -u $keypress_wait
|
||||
rm -f $keypress_wait
|
||||
rm -f $keypress_wait 2>/dev/null
|
||||
} &
|
||||
|
||||
local consoles="$(cat /sys/class/tty/console/active)"
|
||||
|
|
@ -68,7 +68,7 @@ fs_wait_for_key () {
|
|||
;;
|
||||
esac
|
||||
lock -u $keypress_wait
|
||||
rm -f $keypress_wait
|
||||
rm -f $keypress_wait 2>/dev/null
|
||||
}
|
||||
done
|
||||
} &
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue