Btrfs-progs: remove unsed pthread attribute objects
[platform/upstream/btrfs-progs.git] / cmds-send.c
index 9d49ce9..1cd457d 100644 (file)
@@ -240,7 +240,6 @@ static int do_send(struct btrfs_send *send, u64 parent_root_id,
 {
        int ret;
        pthread_t t_read;
-       pthread_attr_t t_attr;
        struct btrfs_ioctl_send_args io_send;
        void *t_err = NULL;
        int subvol_fd = -1;
@@ -254,8 +253,6 @@ static int do_send(struct btrfs_send *send, u64 parent_root_id,
                goto out;
        }
 
-       ret = pthread_attr_init(&t_attr);
-
        ret = pipe(pipefd);
        if (ret < 0) {
                ret = -errno;
@@ -268,7 +265,7 @@ static int do_send(struct btrfs_send *send, u64 parent_root_id,
        send->send_fd = pipefd[0];
 
        if (!ret)
-               ret = pthread_create(&t_read, &t_attr, dump_thread,
+               ret = pthread_create(&t_read, NULL, dump_thread,
                                        send);
        if (ret) {
                ret = -ret;
@@ -317,8 +314,6 @@ static int do_send(struct btrfs_send *send, u64 parent_root_id,
                goto out;
        }
 
-       pthread_attr_destroy(&t_attr);
-
        ret = 0;
 
 out:
@@ -524,11 +519,8 @@ int cmd_send(int argc, char **argv)
                }
        }
 
-       if (optind == argc) {
-               fprintf(stderr, "ERROR: send needs path to snapshot\n");
-               ret = 1;
-               goto out;
-       }
+       if (optind == argc)
+               usage(cmd_send_usage);
 
        if (outname != NULL) {
                send.dump_fd = creat(outname, 0600);