From 6736b550f112f14c17401329a6a2a63ddc53e68b Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sun, 17 Jan 2016 15:50:32 -0500 Subject: cmd/*: Check return value of session_begin() Also clean up on error now. --- (limited to 'src/cmd/shell.sh') diff --git a/src/cmd/shell.sh b/src/cmd/shell.sh index 314b79b..8d5cd16 100644 --- a/src/cmd/shell.sh +++ b/src/cmd/shell.sh @@ -44,7 +44,10 @@ cmd_shell_main() return 2 fi - session_begin "${root}" . : false + if ! session_begin "${root}" . : false; then + [ "x${dev}" != 'x' ] && block_umount "${root}" + return 2 + fi if [ ${#} -eq 0 ]; then session_exec /bin/sh printf '\n' -- cgit v0.9.1