[PATCH 7/7] autofs-5.1.8 - define _SWORD_TYPE for musl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Copy the definition from glibc. Fixes build failures like:
```
automount.c:280:35: error: '__SWORD_TYPE' undeclared (first use in this function)
  280 |                 if (fs.f_type != (__SWORD_TYPE) AUTOFS_SUPER_MAGIC) {
      |                                   ^~~~~~~~~~~~
automount.c:280:35: note: each undeclared identifier is reported only once for each function it appears in
automount.c:280:48: error: expected ')' before numeric constant
  280 |                 if (fs.f_type != (__SWORD_TYPE) AUTOFS_SUPER_MAGIC) {
      |                    ~                           ^
      |                                                )
```

Tested-by: Yixun Lan <dlan@xxxxxxxxxx>
Signed-off-by: Sam James <sam@xxxxxxxxxx>
---
 daemon/automount.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/daemon/automount.c b/daemon/automount.c
index cc28689..5dffce0 100644
--- a/daemon/automount.c
+++ b/daemon/automount.c
@@ -48,6 +48,16 @@
 #endif
 #endif
 
+#ifndef __SWORD_TYPE
+#if __WORDSIZE == 32
+# define __SWORD_TYPE	int
+#elif __WORDSIZE == 64
+# define __SWORD_TYPE	long int
+#else
+#error
+#endif
+#endif
+
 const char *program;		/* Initialized with argv[0] */
 const char *version = VERSION_STRING;	/* Program version */
 const char *libdir = AUTOFS_LIB_DIR;	/* Location of library modules */
-- 
2.34.1




[Index of Archives]     [Linux Filesystem Development]     [Linux Ext4]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux