openwrt-redmi-ax3000/package/utils/mtd-utils/patches/006-ubifs-utils-journal-Include-sys-stat.h.patch
Hauke Mehrtens 6ad9daf99a mtd-utils: Update to version 2.3.0
See announcement mail for list of new features:
https://lists.infradead.org/pipermail/linux-mtd/2025-February/108248.html

Cherry pick some upstream commits which fix build problems in some
situations.

autoreconf fixup is needed now otherwise the build fails with:
```
mtd-utils-2.3.0/missing: line 81: automake-1.16: command not found
```

The code in tests/ubifs_tools-tests/Makemodule.am does not build because
some test data is not packaged in the tar files, do not build code from
this directory.

The size increased only very little:
 61498 bin/targets/ramips/mt7621/packages/nand-utils-2.3.0-r1.apk
101643 bin/targets/ramips/mt7621/packages/ubi-utils-2.3.0-r1.apk
 61243 bin/targets/ramips/mt7621/packages/nand-utils-2.2.1-r1.apk
101291 bin/targets/ramips/mt7621/packages/ubi-utils-2.2.1-r1.apk

Link: https://github.com/openwrt/openwrt/pull/20540
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-08 21:03:46 +01:00

34 lines
1.2 KiB
Diff

From 173f9714c8da1d685bfa951d43b9310d16bbab3c Mon Sep 17 00:00:00 2001
From: Fabio Estevam <festevam@gmail.com>
Date: Wed, 19 Feb 2025 10:02:42 -0300
Subject: ubifs-utils: journal: Include <sys/stat.h>
Include the <sys/stat.h> header file to fix the following error
when building with musl:
| ../git/ubifs-utils/libubifs/journal.c: In function 'ubifs_get_dent_type':
| ../git/ubifs-utils/libubifs/journal.c:414:24: error: 'S_IFMT' undeclared (first use in this function)
| 414 | switch (mode & S_IFMT) {
| | ^~~~~~
| ../git/ubifs-utils/libubifs/journal.c:414:24: note: each undeclared identifier is reported only once for each function it appears in
| ../git/ubifs-utils/libubifs/journal.c:415:14: error: 'S_IFREG' undeclared (first use in this function)
| 415 | case S_IFREG:
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
---
ubifs-utils/libubifs/journal.c | 1 +
1 file changed, 1 insertion(+)
--- a/ubifs-utils/libubifs/journal.c
+++ b/ubifs-utils/libubifs/journal.c
@@ -46,6 +46,7 @@
* all the nodes.
*/
+#include <sys/stat.h>
#include "bitops.h"
#include "kmem.h"
#include "ubifs.h"