inotify-tools: fix compilation with musl 1.2.4
authorNick Hainke <[email protected]>
Tue, 16 May 2023 21:41:26 +0000 (23:41 +0200)
committerTianling Shen <[email protected]>
Thu, 18 May 2023 11:20:03 +0000 (19:20 +0800)
Fixes errors in the form of:
inotifytools.c: In function 'inotifytools_watch_recursively_with_exclude':
inotifytools.c:1335:30: error: storage size of 'my_stat' isn't known
 1335 |         static struct stat64 my_stat;
      |                              ^~~~~~~
inotifytools.c:1342:36: error: implicit declaration of function 'lstat64'; did you mean 'lstat'? [-Werror=implicit-function-declaration]
 1342 |                         if ( -1 == lstat64( next_file, &my_stat ) ) {
      |                                    ^~~~~~~
      |                                    lstat
inotifytools.c:1335:30: error: unused variable 'my_stat' [-Werror=unused-variable]
 1335 |         static struct stat64 my_stat;
      |                              ^~~~~~~
inotifytools.c: In function 'isdir':
inotifytools.c:1621:30: error: storage size of 'my_stat' isn't known
 1621 |         static struct stat64 my_stat;
      |                              ^~~~~~~
inotifytools.c:1621:30: error: unused variable 'my_stat' [-Werror=unused-variable]
inotifytools.c:1630:1: error: control reaches end of non-void function [-Werror=return-type]
 1630 | }
      | ^
cc1: all warnings being treated as errors

Signed-off-by: Nick Hainke <[email protected]>
utils/inotify-tools/Makefile

index 090f044d8fba4f87de5f728919b5b603f5a4f8bc..a5d4203cf5977cdb5645a8c198a735c4dd5b6dec 100644 (file)
@@ -3,7 +3,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=inotify-tools
 PKG_VERSION:=3.20.11.0
 PKG_HASH:=58a3cde89e4a5111a87ac16b56b06a8f885460fca0aea51b69c856ce30a37a14
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_URL:=https://codeload.github.com/rvoicilas/inotify-tools/tar.gz/$(PKG_VERSION)?
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
@@ -19,6 +19,10 @@ include $(INCLUDE_DIR)/package.mk
 
 CONFIGURE_ARGS+= --disable-doxygen
 
+ifneq ($(CONFIG_USE_MUSL),)
+  TARGET_CFLAGS += -D_LARGEFILE64_SOURCE
+endif
+
 define Build/Prepare
        $(call Build/Prepare/Default)
        $(CP) $(PKG_BUILD_DIR)/README.md $(PKG_BUILD_DIR)/README