diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-01-14 13:43:31 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-01-14 13:43:31 +0100 |
commit | 586f1ee7cfcb442caf467a4ea5fb9351ef3c0d11 (patch) | |
tree | 66100b251395e585ded5dd736fc994a3595c0e90 /miscutils | |
parent | 36495af81fb9d312bb04250fba3ea7fa2c209c81 (diff) | |
download | busybox-w32-586f1ee7cfcb442caf467a4ea5fb9351ef3c0d11.tar.gz busybox-w32-586f1ee7cfcb442caf467a4ea5fb9351ef3c0d11.tar.bz2 busybox-w32-586f1ee7cfcb442caf467a4ea5fb9351ef3c0d11.zip |
nandwrite: cope with old headers which have no MTD_FILE_MODE_RAW
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'miscutils')
-rw-r--r-- | miscutils/nandwrite.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/miscutils/nandwrite.c b/miscutils/nandwrite.c index 72f028ed3..29c800612 100644 --- a/miscutils/nandwrite.c +++ b/miscutils/nandwrite.c | |||
@@ -53,6 +53,15 @@ | |||
53 | #include "libbb.h" | 53 | #include "libbb.h" |
54 | #include <mtd/mtd-user.h> | 54 | #include <mtd/mtd-user.h> |
55 | 55 | ||
56 | /* Old headers call it MTD_MODE_RAW. | ||
57 | * FIXME: In kernel headers, MTD_FILE_MODE_RAW is not a define, | ||
58 | * it's an enum. How I can test for existence of an enum? | ||
59 | */ | ||
60 | #if !defined(MTD_FILE_MODE_RAW) | ||
61 | # define MTD_FILE_MODE_RAW 3 | ||
62 | #endif | ||
63 | |||
64 | |||
56 | #define IS_NANDDUMP (ENABLE_NANDDUMP && (!ENABLE_NANDWRITE || (applet_name[4] == 'd'))) | 65 | #define IS_NANDDUMP (ENABLE_NANDDUMP && (!ENABLE_NANDWRITE || (applet_name[4] == 'd'))) |
57 | #define IS_NANDWRITE (ENABLE_NANDWRITE && (!ENABLE_NANDDUMP || (applet_name[4] != 'd'))) | 66 | #define IS_NANDWRITE (ENABLE_NANDWRITE && (!ENABLE_NANDDUMP || (applet_name[4] != 'd'))) |
58 | 67 | ||