lib.sh and rom.sh: stricter mktemp usage

error out under fault condition

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2025-09-01 08:14:49 +01:00
parent 40f064ae33
commit ed84d33e59
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -114,7 +114,8 @@ unpad_one_byte()
fx_()
{
fd="`mktemp`" && x_ rm -f "$fd" && x_ touch "$fd"
fd="`mktemp || err "can't create tmpfile"`" || err
x_ rm -f "$fd" && x_ touch "$fd"
xx="$1" && shift 1
"$@" 2>/dev/null | sort 1>"$fd" 2>/dev/null || err "FATAL: !sort fx_"
dx_ "$xx" "$fd" || :
+1 -1
View File
@@ -257,7 +257,7 @@ cprom()
newrom="${newrom%.rom}_${tmpnew%.gkb}.rom"
irom="$tmprom"
[ $# -lt 1 ] || irom="`mktemp`" || err "!mk irom, $(echo "$@")"
[ $# -lt 1 ] || irom="`mktemp || err "!mk irom, $(echo "$@")"`" || err
[ $# -gt 0 ] && x_ cp "$tmprom" "$irom" && cpcmd="mv"
[ $# -gt 0 ] && [ "${1%.gkb}" != "$1" ] && \