]> xenbits.xensource.com Git - unikraft/libs/newlib.git/commitdiff
patches: Fix setgroups declaration in origin
authorCostin Lupu <costin.lupu@cs.pub.ro>
Wed, 29 May 2019 16:37:25 +0000 (19:37 +0300)
committerFelipe Huici <felipe.huici@neclab.eu>
Thu, 30 May 2019 05:35:32 +0000 (07:35 +0200)
It seems that the setgroups() declaration is not POSIX. The patch fixes
that.

Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
patches/0004-Fix-setgroups-declaration.patch [new file with mode: 0644]

diff --git a/patches/0004-Fix-setgroups-declaration.patch b/patches/0004-Fix-setgroups-declaration.patch
new file mode 100644 (file)
index 0000000..52a9ec7
--- /dev/null
@@ -0,0 +1,28 @@
+From f3e2d3999be2889a559423d03c5bbbbd32d4b8c6 Mon Sep 17 00:00:00 2001
+Date: Wed, 29 May 2019 19:10:31 +0300
+Subject: [PATCH] Fix setgroups declaration
+
+In POSIX, 'ngroups' parameter of 'setgroups' function is of type
+'size_t' instead of 'int'.
+
+Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
+---
+ newlib/libc/include/sys/unistd.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/newlib/libc/include/sys/unistd.h b/newlib/libc/include/sys/unistd.h
+index 75f8a51..bcb2f69 100644
+--- a/newlib/libc/include/sys/unistd.h
++++ b/newlib/libc/include/sys/unistd.h
+@@ -188,7 +188,7 @@ int     _EXFUN(seteuid, (uid_t __uid ));
+ int     _EXFUN(setgid, (gid_t __gid ));
+ #endif
+ #if __BSD_VISIBLE
+-int   _EXFUN(setgroups, (int ngroups, const gid_t *grouplist ));
++int   _EXFUN(setgroups, (size_t ngroups, const gid_t *grouplist ));
+ #endif
+ #if __BSD_VISIBLE || (__XSI_VISIBLE && __XSI_VISIBLE < 500)
+ int   _EXFUN(sethostname, (const char *, size_t));
+-- 
+2.11.0
+