#include "defs.h"
-#include <linux/ioctl.h>
+#ifdef HAVE_STRUCT_UBI_ATTACH_REQ_MAX_BEB_PER1024
-/* The UBI api changes, so we have to keep a local copy */
-#include <linux/version.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 7, 0)
-# include "ubi-user.h"
-#else
+# include <linux/ioctl.h>
# include <mtd/ubi-user.h>
-#endif
-#include "xlat/ubi_volume_types.h"
-#include "xlat/ubi_volume_props.h"
+# include "xlat/ubi_volume_types.h"
+# include "xlat/ubi_volume_props.h"
int
ubi_ioctl(struct tcb *const tcp, const unsigned int code,
CLAMP(mkvol.name_len, 0,
UBI_MAX_VOLUME_NAME));
tprints("}");
- return 1;
+ return 0;
}
if (!syserror(tcp)) {
tprints(" => ");
", max_beb_per1024=%" PRIi16 "}",
attach.ubi_num, attach.mtd_num,
attach.vid_hdr_offset, attach.max_beb_per1024);
- return 1;
+ return 0;
}
if (!syserror(tcp)) {
tprints(" => ");
printnum_int(tcp, arg, "%d");
break;
-#ifdef UBI_IOCVOLCRBLK
+# ifdef UBI_IOCVOLCRBLK
case UBI_IOCVOLCRBLK:
-#endif
-#ifdef UBI_IOCVOLRMBLK
+# endif
+# ifdef UBI_IOCVOLRMBLK
case UBI_IOCVOLRMBLK:
-#endif
+# endif
/* no arguments */
break;
return RVAL_DECODED;
}
- return RVAL_DECODED | 1;
+ return RVAL_IOCTL_DECODED;
}
+
+#endif /* HAVE_STRUCT_UBI_ATTACH_REQ_MAX_BEB_PER1024 */