diff options
author | Felix Fietkau <nbd@openwrt.org> | 2015-06-05 09:00:02 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2015-06-05 09:00:02 +0000 |
commit | 9e233fb241157ca30b1f5d462751490f34f0f435 (patch) | |
tree | c22b3eb4c5db9071a368c1859ac9b681f5b81ba2 /package/system/mtd/src | |
parent | 4480fbce62bdd8b726d3da750acaee267c219715 (diff) | |
download | mtk-20170518-9e233fb241157ca30b1f5d462751490f34f0f435.zip mtk-20170518-9e233fb241157ca30b1f5d462751490f34f0f435.tar.gz mtk-20170518-9e233fb241157ca30b1f5d462751490f34f0f435.tar.bz2 |
mtd: add missing <endian.h> include
trx.c in mtd would not include endian.h, so on systems that do not have
this header implicitly included from the other headers (like musl), both
__BYTE_ORDER and __BIG_ENDIAN would be undefined and thus 0, leading to
it always presuming a big-endian system. this would lead to issues when
running mtd fixtrx on little-endian systems, as it would never recognize
the TRX magic as result of the broken STORE32_LE() macro.
Signed-off-by: Shiz <hi@shiz.me>
Tested-by: Shiz <hi@shiz.me>
SVN-Revision: 45896
Diffstat (limited to 'package/system/mtd/src')
-rw-r--r-- | package/system/mtd/src/trx.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/package/system/mtd/src/trx.c b/package/system/mtd/src/trx.c index 089d1ac..245ee76 100644 --- a/package/system/mtd/src/trx.c +++ b/package/system/mtd/src/trx.c @@ -26,6 +26,7 @@ #include <fcntl.h> #include <sys/mman.h> #include <sys/stat.h> +#include <endian.h> #include <string.h> #include <errno.h> |