[rtems commit] 2012-03-02 Ralf Cors épius <ralf.corsepius at rtems.org>

Ralf Corsepius ralf at rtems.org
Fri Mar 2 08:40:47 UTC 2012


Module:    rtems
Branch:    master
Commit:    396b80ebf6bc0e21d0128b9e768a8243e32372d8
Changeset: http://git.rtems.org/rtems/commit/?id=396b80ebf6bc0e21d0128b9e768a8243e32372d8

Author:    Ralf Corsépius <ralf.corsepius at rtems.org>
Date:      Fri Mar  2 09:31:38 2012 +0100

2012-03-02 Ralf Corsépius <ralf.corsepius at rtems.org>

	* configure.ac: Check for rcmd in unistd.h.
	* libnetworking/libc/rcmd.c: Build iff rcmd is declared in unistd.h.
	Change rcmd's decl to match with Linux/FreeBSD's decl.

---

 cpukit/ChangeLog                 |    6 ++++++
 cpukit/configure.ac              |    1 +
 cpukit/libnetworking/libc/rcmd.c |    5 ++++-
 3 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index 43b2620..bebed7c 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,3 +1,9 @@
+2012-03-02	Ralf Corsépius <ralf.corsepius at rtems.org>
+
+	* configure.ac: Check for rcmd in unistd.h.
+	* libnetworking/libc/rcmd.c: Build iff rcmd is declared in unistd.h.
+	Change rcmd's decl to match with Linux/FreeBSD's decl.
+
 2011-12-14	Sebastian Huber <sebastian.huber at embedded-brains.de>
 
 	PR 1924/cpukit
diff --git a/cpukit/configure.ac b/cpukit/configure.ac
index e3c6a59..7c5c731 100644
--- a/cpukit/configure.ac
+++ b/cpukit/configure.ac
@@ -302,6 +302,7 @@ AC_CHECK_DECLS([LONG_BIT],,,[#include <limits.h>])
 
 ## BSD-ism, excluded from POSIX, but available on most platforms
 AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>])
+AC_CHECK_DECLS([rcmd],,,[#include <unistd.h>])
 
 ## Check if libc provides BSD's strlcpy/strlcat
 AC_CHECK_FUNCS(strlcpy strlcat)
diff --git a/cpukit/libnetworking/libc/rcmd.c b/cpukit/libnetworking/libc/rcmd.c
index d0fb281..99e4f89 100644
--- a/cpukit/libnetworking/libc/rcmd.c
+++ b/cpukit/libnetworking/libc/rcmd.c
@@ -37,6 +37,8 @@
 #include "config.h"
 #endif
 
+#if HAVE_DECL_RCMD
+
 #include <sys/param.h>
 #include <sys/socket.h>
 #include <sys/stat.h>
@@ -81,7 +83,7 @@ static int __icheckhost(const struct sockaddr *, socklen_t, const char *);
 int
 rcmd(
 	char **ahost,
-	u_short rport,
+	int rport,
 	const char *locuser,
 	const char *remuser,
 	const char *cmd,
@@ -545,3 +547,4 @@ __icheckhost(raddr, lhost)
 	return (0);
 }
 #endif
+#endif




More information about the vc mailing list