Skip to content

Commit

Permalink
Make argument to setgroups() const
Browse files Browse the repository at this point in the history
This avoid warnings and/or errors for packages that use a wrapper for that
function with a const argument
  • Loading branch information
th-otto committed Apr 16, 2024
1 parent 92c0547 commit a3e096c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
6 changes: 2 additions & 4 deletions include/grp.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,9 @@ __EXTERN struct group * getgrgid __P ((int gid));
__EXTERN struct group * getgrnam __P ((const char *name));

#ifdef __USE_BSD
__EXTERN int initgroups __P ((const char* __user, __gid_t __groups));
__EXTERN int setgroups __P ((size_t __count, __gid_t* __groups));
__EXTERN int initgroups __P ((const char* __user, __gid_t __group));
__EXTERN int setgroups __P ((size_t __count, const __gid_t* __groups));
#endif
__EXTERN int __initgroups __P ((const char* __user, __gid_t __groups));
__EXTERN int __setgroups __P ((size_t __count, __gid_t* __groups));

__END_DECLS

Expand Down
2 changes: 1 addition & 1 deletion mintlib/syscalls.list
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ getgroups int int ptr
chown int ptr int int
select int int ptr ptr ptr
getrusage int int ptr
initgroups int ptr int
initgroups int ptr long
setgroups int long ptr
getrlimit int int ptr
setrlimit int int ptr
Expand Down
2 changes: 2 additions & 0 deletions pwdgrp/initgroups.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include <sys/types.h>
#include <mint/mintbind.h>

__typeof__(initgroups) __initgroups;

int
__initgroups (const char *user, gid_t group)
{
Expand Down
4 changes: 3 additions & 1 deletion unix/setgroups.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
#include <sys/types.h>
#include <mint/mintbind.h>

__typeof__(setgroups) __setgroups;

int
__setgroups (size_t count, gid_t *groups)
__setgroups (size_t count, const gid_t *groups)
{
int r;

Expand Down

0 comments on commit a3e096c

Please sign in to comment.