* Boston, MA 021110-1307, USA.
*/
-#define _GNU_SOURCE
-
#include <unistd.h>
#include <stdint.h>
#include <dirent.h>
void *user)
{
struct recv_args *r = user;
- char uuid_str[128];
+ char uuid_str[BTRFS_UUID_UNPARSED_SIZE];
r->full_subvol_path = path_cat(r->root_path, path);
uuid_unparse(uuid, uuid_str);
void *user)
{
struct recv_args *r = user;
- char uuid_str[128];
- char parent_uuid_str[128];
+ char uuid_str[BTRFS_UUID_UNPARSED_SIZE];
+ char parent_uuid_str[BTRFS_UUID_UNPARSED_SIZE];
r->full_subvol_path = path_cat(r->root_path, path);
uuid_unparse(uuid, uuid_str);
return 0;
}
-struct btrfs_send_ops send_ops_print = {
+static struct btrfs_send_ops send_ops_print = {
.subvol = print_subvol,
.snapshot = print_snapshot,
.mkfile = print_mkfile,
while (1) {
ret = btrfs_read_and_process_send_stream(pipefd[0],
- &send_ops_print, arg_);
+ &send_ops_print, arg_, 0);
if (ret)
break;
}
int ret = 0;
int subvol_fd;
pthread_t t_read;
- pthread_attr_t t_attr;
void *t_err = NULL;
struct recv_args r;
goto out;
}
- ret = pthread_attr_init(&t_attr);
- if (ret < 0) {
- fprintf(stderr, "ERROR: pthread init failed. %s\n",
- strerror(ret));
- goto out;
- }
-
ret = pipe(pipefd);
if (ret < 0) {
ret = errno;
goto out;
}
- ret = pthread_create(&t_read, &t_attr, process_thread, &r);
+ ret = pthread_create(&t_read, NULL, process_thread, &r);
if (ret < 0) {
ret = errno;
fprintf(stderr, "ERROR: pthread create failed. %s\n",
goto out;
}
- pthread_attr_destroy(&t_attr);
out:
- return ret;
+ return !!ret;
}