diff options
author | Zach Brown <zab@redhat.com> | 2013-01-24 10:45:00 -0800 |
---|---|---|
committer | Zach Brown <zab@redhat.com> | 2013-02-05 16:09:40 -0800 |
commit | df13b84670264657da35146d0f3a10e0a5989503 (patch) | |
tree | 829a75553bfb33050dd573bade2db3179b746cf2 /cmds-inspect.c | |
parent | 065fa46f5de017d6a01263623442b31f44e41cd2 (diff) |
btrfs-progs: close fd in inode resolve
Signed-off-by: Zach Brown <zab@redhat.com>
Diffstat (limited to 'cmds-inspect.c')
-rw-r--r-- | cmds-inspect.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cmds-inspect.c b/cmds-inspect.c index f10bf55e..4347c1ac 100644 --- a/cmds-inspect.c +++ b/cmds-inspect.c @@ -85,6 +85,7 @@ static int cmd_inode_resolve(int argc, char **argv) { int fd; int verbose = 0; + int ret; optind = 1; while (1) { @@ -110,8 +111,11 @@ static int cmd_inode_resolve(int argc, char **argv) return 12; } - return __ino_to_path_fd(atoll(argv[optind]), fd, verbose, - argv[optind+1]); + ret = __ino_to_path_fd(atoll(argv[optind]), fd, verbose, + argv[optind+1]); + close(fd); + return ret; + } static const char * const cmd_logical_resolve_usage[] = { |