btrfs-progs: check: introduce function to check block group item
[platform/upstream/btrfs-progs.git] / cmds-receive.c
index 094a607..f4a3a4f 100644 (file)
@@ -644,7 +644,7 @@ static int open_inode_for_write(struct btrfs_receive *r, const char *path)
        r->write_fd = open(path, O_RDWR);
        if (r->write_fd < 0) {
                ret = -errno;
-               error("cannont open %s: %s", path, strerror(-ret));
+               error("cannot open %s: %s", path, strerror(-ret));
                goto out;
        }
        strncpy_null(r->write_path, path);
@@ -1266,6 +1266,8 @@ int cmd_receive(int argc, char **argv)
        }
 
        ret = do_receive(&r, tomnt, realmnt, receive_fd, max_errors);
+       if (receive_fd != fileno(stdin))
+               close(receive_fd);
 
 out: