ret = do_defrag(fd, defrag_global_fancy_ioctl, &defrag_global_range);
e = errno;
close(fd);
- if (ret && e == ENOTTY) {
+ if (ret && e == ENOTTY && defrag_global_fancy_ioctl) {
fprintf(stderr, "ERROR: defrag range ioctl not "
"supported in this kernel, please try "
"without any options.\n");
e = errno;
}
close_file_or_dir(fd, dirstream);
- if (ret && e == ENOTTY) {
+ if (ret && e == ENOTTY && defrag_global_fancy_ioctl) {
fprintf(stderr, "ERROR: defrag range ioctl not "
"supported in this kernel, please try "
"without any options.\n");