From 69a55d30acd19bc0461704713e11ab020d4f711c Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Tue, 23 Nov 2010 15:28:42 +0200 Subject: [PATCH] Coupld portability fixes --- m4/usual.m4 | 2 +- test/test_netdb.c | 2 +- usual/netdb.c | 2 +- usual/socket.c | 5 +++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/m4/usual.m4 b/m4/usual.m4 index 627a7c2..9f54119 100644 --- a/m4/usual.m4 +++ b/m4/usual.m4 @@ -83,7 +83,7 @@ if test x"$GCC" = xyes; then # avoid -Wextra if missing-field.initializers does not work echo "$warnings" | grep missing-field-initializers > /dev/null \ - || warnings=`echo "$warnings"|sed 's/-Wextra//'` + || WFLAGS=`echo "$WFLAGS"|sed 's/ -Wextra//'` CFLAGS="$good_CFLAGS" AC_MSG_RESULT([done]) diff --git a/test/test_netdb.c b/test/test_netdb.c index b816654..ce0c0dd 100644 --- a/test/test_netdb.c +++ b/test/test_netdb.c @@ -8,7 +8,7 @@ static int gotres; -static void cb_func(sigval_t v) +static void cb_func(union sigval v) { gotres++; } diff --git a/usual/netdb.c b/usual/netdb.c index beaa857..77e81de 100644 --- a/usual/netdb.c +++ b/usual/netdb.c @@ -42,7 +42,7 @@ int getaddrinfo_a(int mode, struct gaicb *list[], int nitems, struct sigevent *s if (sevp->sigev_notify == SIGEV_SIGNAL) { raise(sevp->sigev_signo); } else if (sevp->sigev_notify == SIGEV_THREAD) { - sigval_t sv; + union sigval sv; sevp->sigev_notify_function(sv); } else goto einval; diff --git a/usual/socket.c b/usual/socket.c index bb9a931..77d961e 100644 --- a/usual/socket.c +++ b/usual/socket.c @@ -205,8 +205,9 @@ int getpeereid(int fd, uid_t *uid_p, gid_t *gid_p) *uid_p = ucred_geteuid(cred); *gid_p = ucred_getegid(cred); ucred_free(cred); - if (*uid_p >= 0 && *gid_p >= 0) - return 0; + if ((int)*uid_p == -1 || (int)*gid_p == -1) + return -1; + return 0; } #else errno = ENOSYS; -- 2.39.5