diff options
author | P. J. McDermott <pj@pehjota.net> | 2016-01-17 15:50:32 (EST) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2016-01-17 15:50:32 (EST) |
commit | 6736b550f112f14c17401329a6a2a63ddc53e68b (patch) | |
tree | 68e54ba4a7879189faaf3756cdd56c444eeb0b7d /src/cmd/opkg.sh | |
parent | 9add17a7f4a24fe04a7a93782e51ce710d7e371e (diff) |
cmd/*: Check return value of session_begin()
Also clean up on error now.
Diffstat (limited to 'src/cmd/opkg.sh')
-rw-r--r-- | src/cmd/opkg.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cmd/opkg.sh b/src/cmd/opkg.sh index e6a304f..b99a977 100644 --- a/src/cmd/opkg.sh +++ b/src/cmd/opkg.sh @@ -85,7 +85,11 @@ cmd_opkg_main() return 2 fi - session_begin "${root}" . cmd_opkg_fini false + if ! session_begin "${root}" . cmd_opkg_fini false; then + cmd_opkg_fini + [ "x${dev}" != 'x' ] && block_umount "${root}" + return 2 + fi session_exec opkg "${@}" |