summaryrefslogtreecommitdiffstats
path: root/src/cmd/shell.sh
diff options
context:
space:
mode:
authorP. 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)
commit6736b550f112f14c17401329a6a2a63ddc53e68b (patch)
tree68e54ba4a7879189faaf3756cdd56c444eeb0b7d /src/cmd/shell.sh
parent9add17a7f4a24fe04a7a93782e51ce710d7e371e (diff)
cmd/*: Check return value of session_begin()
Also clean up on error now.
Diffstat (limited to 'src/cmd/shell.sh')
-rw-r--r--src/cmd/shell.sh5
1 files changed, 4 insertions, 1 deletions
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'