fdmnt = open_file_or_dir(mntpnt, &dirstream);
if (fdmnt < 0) {
fprintf(stderr, "ERROR: can't access to '%s'\n", mntpnt);
- return 12;
+ return 1;
}
for (i = 1; i < argc - 1; i++ ){
}
close_file_or_dir(fdmnt, dirstream);
- if (ret)
- return ret+20;
- else
- return 0;
+ return !!ret;
}
static const char * const cmd_rm_dev_usage[] = {
fdmnt = open_file_or_dir(mntpnt, &dirstream);
if (fdmnt < 0) {
fprintf(stderr, "ERROR: can't access to '%s'\n", mntpnt);
- return 12;
+ return 1;
}
for(i=1 ; i < argc - 1; i++ ){
}
close_file_or_dir(fdmnt, dirstream);
- if( ret)
- return ret+20;
- else
- return 0;
+ return !!ret;
}
static const char * const cmd_scan_dev_usage[] = {
ret = scan_for_btrfs(where, 1);
if (ret){
fprintf(stderr, "ERROR: error %d while scanning\n", ret);
- return 18;
+ return 1;
}
return 0;
}
fd = open("/dev/btrfs-control", O_RDWR);
if (fd < 0) {
perror("failed to open /dev/btrfs-control");
- return 10;
+ return 1;
}
for( i = devstart ; i < argc ; i++ ){
close(fd);
fprintf(stderr, "ERROR: unable to scan the device '%s' - %s\n",
argv[i], strerror(e));
- return 11;
+ return 1;
}
}
fd = open("/dev/btrfs-control", O_RDWR);
if (fd < 0) {
perror("failed to open /dev/btrfs-control");
- return 10;
+ return 1;
}
strncpy(args.name, argv[argc - 1], BTRFS_PATH_NAME_MAX);
if (fdmnt < 0) {
fprintf(stderr, "ERROR: can't access '%s'\n", dev_path);
- return 12;
+ return 1;
}
ret = get_fs_info(dev_path, &fi_args, &di_args);