Remove dependency on the <sys/param.h> header
Subsystems (2)
PATCH 6/7 Remove dependency on the <sys/param.h> header
The header <sys/param.h> is of BSD origin and is mainly used for system limit constants such as MAXHOSTNAMELEN.
Remove unecessary inclusions of <sys/param.h> and replace limit constants by equivalent POSIX constants from <limits.h>.
Signed-off-by Felix Janda <[email protected]>
--- configure.ac | 2 +- src/auth_unix.c | 4 ++-- src/clnt_simple.c | 1 - src/getpeereid.c | 1 - src/netname.c | 1 - src/netnamer.c | 1 - src/rpc_generic.c | 1 - src/rpc_prot.c | 2 -- src/svc_auth_des.c | 4 ++-- src/svc_vc.c | 1 - src/xdr_float.c | 1 - tirpc/rpc/types.h | 1 - 12 files changed, 5 insertions(+), 15 deletions(-)
configure.ac +1 -1
@@ -85,7 +85,7 @@ AC_CONFIG_HEADERS([config.h]) AC_PROG_LIBTOOL AC_HEADER_DIRENT AC_PREFIX_DEFAULT(/usr) -AC_CHECK_HEADERS([arpa/inet.h fcntl.h libintl.h limits.h locale.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h unistd.h features.h gssapi/gssapi_ext.h]) +AC_CHECK_HEADERS([arpa/inet.h fcntl.h libintl.h limits.h locale.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h syslog.h unistd.h features.h gssapi/gssapi_ext.h]) AC_CHECK_LIB([pthread], [pthread_create]) AC_CHECK_FUNCS([getrpcbyname getrpcbynumber setrpcent endrpcent getrpcent])
src/auth_unix.c +2 -2
@@ -40,7 +40,6 @@*/ #include <pthread.h> #include <reentrant.h> -#include <sys/param.h> #include <assert.h> #include <err.h>
@@ -49,6 +48,7 @@#include <unistd.h> #include <string.h> #include <errno.h> +#include <limits.h> #include <rpc/clnt.h> #include <rpc/types.h>
@@ -183,7 +183,7 @@ AUTH * authunix_create_default() {int len; -char machname[MAXHOSTNAMELEN +1 ]; +char machname[HOST_NAME_MAX +1 ];uid_t uid;gid_t gid, *gids;AUTH *result;
src/clnt_simple.c +0 -1
@@ -36,7 +36,6 @@*/ #include <pthread.h> #include <reentrant.h> -#include <sys/param.h> #include <stdio.h> #include <errno.h> #include <rpc/rpc.h>
src/getpeereid.c +0 -1
@@ -25,7 +25,6 @@*/ -#include <sys/param.h> #include <sys/socket.h> #include <sys/un.h>
src/netname.c +0 -1
@@ -34,7 +34,6 @@* the sun NIS domain architecture. */ -#include <sys/param.h> #include <rpc/rpc.h> #include "rpc_com.h" #ifdef YP
src/netnamer.c +0 -1
@@ -32,7 +32,6 @@* will work with any unix system that has adopted the sun NIS domain * architecture. */ -#include <sys/param.h> #include <rpc/rpc.h> #include "rpc_com.h" #ifdef YP
src/rpc_generic.c +0 -1
@@ -37,7 +37,6 @@#include <pthread.h> #include <reentrant.h> #include <sys/types.h> -#include <sys/param.h> #include <sys/socket.h> #include <sys/time.h> #include <sys/un.h>
src/rpc_prot.c +0 -2
@@ -39,8 +39,6 @@* routines are also in this program. */ -#include <sys/param.h> -#include <assert.h> #include <rpc/rpc.h>
src/svc_auth_des.c +2 -2
@@ -46,12 +46,12 @@*/ #include <pthread.h> #include <reentrant.h> +#include <limits.h> #include <string.h> #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <rpc/des_crypt.h> -#include <sys/param.h> #include <netinet/in.h> #include <rpc/types.h> #include <rpc/xdr.h>
@@ -445,7 +445,7 @@ struct bsdcred {short uid;/* cached uid */ short gid;/* cached gid */ short grouplen;/* length of cached groups */ -short groups[NGROUPS ];/* cached groups */ +short groups[NGROUPS_MAX ];/* cached groups */ };/*
src/svc_vc.c +0 -1
@@ -39,7 +39,6 @@#include <reentrant.h> #include <sys/socket.h> #include <sys/types.h> -#include <sys/param.h> #include <poll.h> #include <sys/un.h> #include <sys/time.h>
src/xdr_float.c +0 -1
@@ -39,7 +39,6 @@*/ #include <sys/types.h> -#include <sys/param.h> #include <stdio.h>
tirpc/rpc/types.h +0 -1
@@ -66,7 +66,6 @@ typedef int32_t rpc_inline_t;#define mem_free (ptr, bsize) free(ptr)#include <sys/time.h> -#include <sys/param.h> #include <stdlib.h> #include <netconfig.h>
Signature · 1 line
2.7.3