From: Theodore Ts'o Date: Sun, 21 Jul 2002 18:17:45 +0000 (-0400) Subject: htree.c (do_htree_dump): Fix a bug where we were not cleanly X-Git-Tag: E2FSPROGS-1.28-WIP-0817~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=155f577b2b28a964f70d21634ff173705a76c7c3;p=thirdparty%2Fe2fsprogs.git htree.c (do_htree_dump): Fix a bug where we were not cleanly closing the pager after errors, which would leave the tty in noecho mode. --- diff --git a/debugfs/ChangeLog b/debugfs/ChangeLog index 7ddbd21ae..b77a62a7e 100644 --- a/debugfs/ChangeLog +++ b/debugfs/ChangeLog @@ -1,3 +1,9 @@ +2002-07-21 Theodore Ts'o + + * htree.c (do_htree_dump): Fix a bug where we were not cleanly + closing the pager after errors, which would leave the + tty in noecho mode. + 2002-07-18 Theodore Ts'o * htree.c (htree_dump_int_node): Add byte swapping code sot that diff --git a/debugfs/htree.c b/debugfs/htree.c index e58384990..1268a845b 100644 --- a/debugfs/htree.c +++ b/debugfs/htree.c @@ -207,7 +207,7 @@ void do_htree_dump(int argc, char *argv[]) if (argc > optind+1) { com_err(0, 0, "Usage: htree_dump [-l] file"); - return; + goto errout; } if (argc == optind) @@ -215,25 +215,25 @@ void do_htree_dump(int argc, char *argv[]) else ino = string_to_inode(argv[optind]); if (!ino) - return; + goto errout; if (debugfs_read_inode(ino, &inode, argv[1])) - return; + goto errout; if (!LINUX_S_ISDIR(inode.i_mode)) { com_err(argv[0], 0, "Not a directory"); - return; + goto errout; } if ((inode.i_flags & EXT2_BTREE_FL) == 0) { com_err(argv[0], 0, "Not a hash-indexed directory"); - return; + goto errout; } buf = malloc(2*current_fs->blocksize); if (!buf) { com_err(argv[0], 0, "Couldn't allocate htree buffer"); - return; + goto errout; } errcode = io_channel_read_blk(current_fs->io, inode.i_block[0],