diff mbox series

[nfs-utils,1/2] support/include/junction.h: Define macros for musl

Message ID 20240908114312.3883312-1-liezhi.yang@windriver.com (mailing list archive)
State New
Headers show
Series [nfs-utils,1/2] support/include/junction.h: Define macros for musl | expand

Commit Message

liezhi.yang@windriver.com Sept. 8, 2024, 11:43 a.m. UTC
From: Robert Yang <liezhi.yang@windriver.com>

Fixed 1:
In file included from cache.c:1217:
../../support/include/junction.h:128:21: error: expected ';' before 'char'
  128 | __attribute_malloc__
      |                     ^
      |                     ;
  129 | char            **nfs_dup_string_array(char **array);

Fixed 2:
junction.c: In function 'junction_set_sticky_bit':
junction.c:164:39: error: 'ALLPERMS' undeclared (first use in this function)
  164 |         stb.st_mode &= (unsigned int)~ALLPERMS;

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 support/include/junction.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/support/include/junction.h b/support/include/junction.h
index 7257d80b..d127dd55 100644
--- a/support/include/junction.h
+++ b/support/include/junction.h
@@ -26,6 +26,16 @@ 
 #ifndef _NFS_JUNCTION_H_
 #define _NFS_JUNCTION_H_
 
+/* For musl, refered to glibc's sys/cdefs.h */
+#ifndef __attribute_malloc__
+#define __attribute_malloc__ __attribute__((__malloc__))
+#endif
+
+/* For musl, refered to glibc's sys/stat.h */
+#ifndef ALLPERMS
+#define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)/* 07777 */
+#endif
+
 #include <stdint.h>
 
 /*