mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 05:52:36 +02:00
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:
+2
-1
@@ -114,7 +114,8 @@ unpad_one_byte()
|
|||||||
|
|
||||||
fx_()
|
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
|
xx="$1" && shift 1
|
||||||
"$@" 2>/dev/null | sort 1>"$fd" 2>/dev/null || err "FATAL: !sort fx_"
|
"$@" 2>/dev/null | sort 1>"$fd" 2>/dev/null || err "FATAL: !sort fx_"
|
||||||
dx_ "$xx" "$fd" || :
|
dx_ "$xx" "$fd" || :
|
||||||
|
|||||||
+1
-1
@@ -257,7 +257,7 @@ cprom()
|
|||||||
newrom="${newrom%.rom}_${tmpnew%.gkb}.rom"
|
newrom="${newrom%.rom}_${tmpnew%.gkb}.rom"
|
||||||
|
|
||||||
irom="$tmprom"
|
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 ] && x_ cp "$tmprom" "$irom" && cpcmd="mv"
|
||||||
|
|
||||||
[ $# -gt 0 ] && [ "${1%.gkb}" != "$1" ] && \
|
[ $# -gt 0 ] && [ "${1%.gkb}" != "$1" ] && \
|
||||||
|
|||||||
Reference in New Issue
Block a user