]> granicus.if.org Git - strace/blobdiff - ubi.c
print_inet_addr: print nameless and named addresses using the same style
[strace] / ubi.c
diff --git a/ubi.c b/ubi.c
index ab4f5ea0cde13b04434401ec6426607ead76b1ad..9f611ff58177d980d09f3fe4dad6a418f306a278 100644 (file)
--- a/ubi.c
+++ b/ubi.c
 
 #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,
@@ -183,12 +178,12 @@ ubi_ioctl(struct tcb *const tcp, const unsigned int code,
                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;
 
@@ -196,5 +191,7 @@ ubi_ioctl(struct tcb *const tcp, const unsigned int code,
                return RVAL_DECODED;
        }
 
-       return RVAL_DECODED | RVAL_IOCTL_PARSED;
+       return RVAL_IOCTL_DECODED;
 }
+
+#endif /* HAVE_STRUCT_UBI_ATTACH_REQ_MAX_BEB_PER1024 */