summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2002-10-28 13:56:01 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2002-10-28 13:56:01 +0000
commitabef0f69aea9d3c7793a0ee8f0895b8c43d881ae (patch)
tree4fc7aba925837e8fffcd4f26a2fa0d81a2c9d9c0
parent2002-10-28 Joel Sherrill <joel@OARcorp.com> (diff)
downloadrtems-abef0f69aea9d3c7793a0ee8f0895b8c43d881ae.tar.bz2
2002-10-28 Joel Sherrill <joel@OARcorp.com>
* Pass to eliminate warnings. * kern/uipc_mbuf.c: Conditional SYSINIT() usage on __rtems__. Fix return statement without a value. * lib/ftpfs.c: read and write filesystem routines return ssize_t. * lib/syslog.c: Add include of <string.h> to eliminate warning. * lib/tftpDriver.c: read and write filesystem routines return ssize_t. * libc/gethostbydns.c: Prototype abort(). * libc/inet_ntoa.c: Prototype strcpy(). * libc/rcmd.c: Add include of <sys/select.h> * net/if_loop.c: Turn token at end of endif to comment. * net/rtsock.c, nfs/bootp_subr.c: Conditional SYSINIT() usage on __rtems__. * rtems/rtems_bootp.c: Add include of <rtems/rtems_bsdnet_internal.h>. * rtems/rtems_bsdnet_internal.h: Added prototypes for memcpy() and memset() since the BSD code tries to avoid using libc .h files since it is used to being in the kernel. * rtems/rtems_syscall.c: read and write filesystem routines return ssize_t.
-rw-r--r--cpukit/libnetworking/ChangeLog21
-rw-r--r--cpukit/libnetworking/kern/uipc_mbuf.c7
-rw-r--r--cpukit/libnetworking/lib/ftpfs.c4
-rw-r--r--cpukit/libnetworking/lib/syslog.c1
-rw-r--r--cpukit/libnetworking/lib/tftpDriver.c4
-rw-r--r--cpukit/libnetworking/libc/gethostbydns.c2
-rw-r--r--cpukit/libnetworking/libc/inet_ntoa.c1
-rw-r--r--cpukit/libnetworking/libc/rcmd.c2
-rw-r--r--cpukit/libnetworking/net/if_loop.c4
-rw-r--r--cpukit/libnetworking/net/rtsock.c8
-rw-r--r--cpukit/libnetworking/nfs/bootp_subr.c6
-rw-r--r--cpukit/libnetworking/rtems/rtems_bootp.c1
-rw-r--r--cpukit/libnetworking/rtems/rtems_bsdnet_internal.h4
-rw-r--r--cpukit/libnetworking/rtems/rtems_syscall.c4
14 files changed, 58 insertions, 11 deletions
diff --git a/cpukit/libnetworking/ChangeLog b/cpukit/libnetworking/ChangeLog
index ed6feb1c28..b14a0d36dd 100644
--- a/cpukit/libnetworking/ChangeLog
+++ b/cpukit/libnetworking/ChangeLog
@@ -1,3 +1,24 @@
+2002-10-28 Joel Sherrill <joel@OARcorp.com>
+
+ * Pass to eliminate warnings.
+ * kern/uipc_mbuf.c: Conditional SYSINIT() usage on __rtems__.
+ Fix return statement without a value.
+ * lib/ftpfs.c: read and write filesystem routines return ssize_t.
+ * lib/syslog.c: Add include of <string.h> to eliminate warning.
+ * lib/tftpDriver.c: read and write filesystem routines return ssize_t.
+ * libc/gethostbydns.c: Prototype abort().
+ * libc/inet_ntoa.c: Prototype strcpy().
+ * libc/rcmd.c: Add include of <sys/select.h>
+ * net/if_loop.c: Turn token at end of endif to comment.
+ * net/rtsock.c, nfs/bootp_subr.c: Conditional SYSINIT() usage
+ on __rtems__.
+ * rtems/rtems_bootp.c: Add include of <rtems/rtems_bsdnet_internal.h>.
+ * rtems/rtems_bsdnet_internal.h: Added prototypes for memcpy() and
+ memset() since the BSD code tries to avoid using libc .h files
+ since it is used to being in the kernel.
+ * rtems/rtems_syscall.c: read and write filesystem routines
+ return ssize_t.
+
2002-10-25 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* configure.ac: Add nostdinc to AM_INIT_AUTOMAKE.
diff --git a/cpukit/libnetworking/kern/uipc_mbuf.c b/cpukit/libnetworking/kern/uipc_mbuf.c
index 4d97ea0bb0..961be6e8b1 100644
--- a/cpukit/libnetworking/kern/uipc_mbuf.c
+++ b/cpukit/libnetworking/kern/uipc_mbuf.c
@@ -50,8 +50,10 @@
#include <vm/vm_kern.h>
#include <vm/vm_extern.h>
+#if !defined(__rtems__)
static void mbinit __P((void *)) __attribute__ ((unused));
SYSINIT(mbuf, SI_SUB_MBUF, SI_ORDER_FIRST, mbinit, NULL)
+#endif
struct mbuf *mbutl;
char *mclrefcnt;
@@ -729,7 +731,7 @@ m_copyback(m0, off, len, cp)
int totlen = 0;
if (m0 == 0)
- return;
+ return 0;
while (off > (mlen = m->m_len)) {
off -= mlen;
totlen += mlen;
@@ -768,7 +770,8 @@ m_copyback(m0, off, len, cp)
m->m_len = mlen;
m = m->m_next;
}
-out: if (((m = m0)->m_flags & M_PKTHDR) && (m->m_pkthdr.len < totlen))
+/*out:*/
+ if (((m = m0)->m_flags & M_PKTHDR) && (m->m_pkthdr.len < totlen))
m->m_pkthdr.len = totlen;
return 0;
}
diff --git a/cpukit/libnetworking/lib/ftpfs.c b/cpukit/libnetworking/lib/ftpfs.c
index 033c1b6bdf..19f8ef8bb9 100644
--- a/cpukit/libnetworking/lib/ftpfs.c
+++ b/cpukit/libnetworking/lib/ftpfs.c
@@ -959,7 +959,7 @@ int rtems_ftp_open(
/*
* Read from a FTP stream
*/
-int rtems_ftp_read(
+ssize_t rtems_ftp_read(
rtems_libio_t *iop,
void *buffer,
unsigned32 count
@@ -1013,7 +1013,7 @@ int rtems_ftp_read(
return count - want_cnt;
}
-int rtems_ftp_write(
+ssize_t rtems_ftp_write(
rtems_libio_t *iop,
const void *buffer,
unsigned32 count
diff --git a/cpukit/libnetworking/lib/syslog.c b/cpukit/libnetworking/lib/syslog.c
index 0bb15bc78e..087dff7cfa 100644
--- a/cpukit/libnetworking/lib/syslog.c
+++ b/cpukit/libnetworking/lib/syslog.c
@@ -12,6 +12,7 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
+#include <string.h>
#include <unistd.h>
diff --git a/cpukit/libnetworking/lib/tftpDriver.c b/cpukit/libnetworking/lib/tftpDriver.c
index 52f51748a5..6ab6c44659 100644
--- a/cpukit/libnetworking/lib/tftpDriver.c
+++ b/cpukit/libnetworking/lib/tftpDriver.c
@@ -791,7 +791,7 @@ static int rtems_tftp_open(
/*
* Read from a TFTP stream
*/
-static int rtems_tftp_read(
+static ssize_t rtems_tftp_read(
rtems_libio_t *iop,
void *buffer,
unsigned32 count
@@ -932,7 +932,7 @@ static int rtems_tftp_close(
return RTEMS_SUCCESSFUL;
}
-static int rtems_tftp_write(
+static ssize_t rtems_tftp_write(
rtems_libio_t *iop,
const void *buffer,
unsigned32 count
diff --git a/cpukit/libnetworking/libc/gethostbydns.c b/cpukit/libnetworking/libc/gethostbydns.c
index 3d80ffde7a..4991ccad22 100644
--- a/cpukit/libnetworking/libc/gethostbydns.c
+++ b/cpukit/libnetworking/libc/gethostbydns.c
@@ -77,6 +77,8 @@ static char rcsid[] = "$Id$";
#include "res_config.h"
+void abort(void); /* to avoid warning */
+
#define SPRINTF(x) ((size_t)sprintf x)
#define MAXALIASES 35
diff --git a/cpukit/libnetworking/libc/inet_ntoa.c b/cpukit/libnetworking/libc/inet_ntoa.c
index 44b686f0b3..0844b6c5ad 100644
--- a/cpukit/libnetworking/libc/inet_ntoa.c
+++ b/cpukit/libnetworking/libc/inet_ntoa.c
@@ -52,6 +52,7 @@ inet_ntoa(in)
struct in_addr in;
{
static char ret[18];
+ char *strcpy(char *dest, const char *src);
strcpy(ret, "[inet_ntoa error]");
(void) inet_ntop(AF_INET, &in, ret, sizeof ret);
diff --git a/cpukit/libnetworking/libc/rcmd.c b/cpukit/libnetworking/libc/rcmd.c
index 8dd4d0cbe2..6dce728d43 100644
--- a/cpukit/libnetworking/libc/rcmd.c
+++ b/cpukit/libnetworking/libc/rcmd.c
@@ -59,6 +59,8 @@ static char sccsid[] = "@(#)rcmd.c 8.3 (Berkeley) 3/26/94";
#include <rpcsvc/ypclnt.h>
#endif
+#include <sys/select.h>
+
#define max(a, b) ((a > b) ? a : b)
diff --git a/cpukit/libnetworking/net/if_loop.c b/cpukit/libnetworking/net/if_loop.c
index 345730c729..6ff6bdfe4d 100644
--- a/cpukit/libnetworking/net/if_loop.c
+++ b/cpukit/libnetworking/net/if_loop.c
@@ -81,7 +81,7 @@
#include <netinet/if_ether.h>
#include <netatalk/at.h>
#include <netatalk/at_var.h>
-#endif NETATALK
+#endif /* NETATALK */
#include "bpfilter.h"
@@ -205,7 +205,7 @@ looutput(ifp, m, dst, rt)
ifq = &atintrq2;
isr = NETISR_ATALK;
break;
-#endif NETATALK
+#endif /* NETATALK */
default:
printf("lo%d: can't handle af%d\n", ifp->if_unit,
dst->sa_family);
diff --git a/cpukit/libnetworking/net/rtsock.c b/cpukit/libnetworking/net/rtsock.c
index 57e777906a..274f6fccff 100644
--- a/cpukit/libnetworking/net/rtsock.c
+++ b/cpukit/libnetworking/net/rtsock.c
@@ -67,8 +67,10 @@ static struct mbuf *
static int rt_msg2 __P((int,
struct rt_addrinfo *, caddr_t, struct walkarg *));
static int rt_xaddrs __P((caddr_t, caddr_t, struct rt_addrinfo *));
+#if !defined(__rtems__)
static int sysctl_dumpentry __P((struct radix_node *rn, void *vw));
static int sysctl_iflist __P((int af, struct walkarg *w));
+#endif
static int route_output __P((struct mbuf *, struct socket *));
static int route_usrreq __P((struct socket *,
int, struct mbuf *, struct mbuf *, struct mbuf *));
@@ -675,6 +677,7 @@ rt_newaddrmsg(cmd, ifa, error, rt)
/*
* This is used in dumping the kernel table via sysctl().
*/
+#if !defined(__rtems__)
int
sysctl_dumpentry(rn, vw)
struct radix_node *rn;
@@ -707,7 +710,9 @@ sysctl_dumpentry(rn, vw)
}
return (error);
}
+#endif
+#if !defined(__rtems__)
int
sysctl_iflist(af, w)
int af;
@@ -762,7 +767,9 @@ sysctl_iflist(af, w)
}
return (0);
}
+#endif
+#if !defined(__rtems__)
static int
sysctl_rtsock SYSCTL_HANDLER_ARGS
{
@@ -807,6 +814,7 @@ sysctl_rtsock SYSCTL_HANDLER_ARGS
}
SYSCTL_NODE(_net, PF_ROUTE, routetable, CTLFLAG_RD, sysctl_rtsock,"");
+#endif
/*
* Definitions of protocols supported in the ROUTE domain.
diff --git a/cpukit/libnetworking/nfs/bootp_subr.c b/cpukit/libnetworking/nfs/bootp_subr.c
index 0d0eb3c4d0..237d75e4b9 100644
--- a/cpukit/libnetworking/nfs/bootp_subr.c
+++ b/cpukit/libnetworking/nfs/bootp_subr.c
@@ -121,8 +121,8 @@ static int md_lookup_swap __P((struct sockaddr_in *mdsin,char *path,
static int setfs __P((struct sockaddr_in *addr, char *path, char *p));
static int getdec __P((char **ptr));
#endif
-static char *substr __P((char *a,char *b));
#if !defined(__rtems__)
+static char *substr __P((char *a,char *b));
static void mountopts __P((struct nfs_args *args, char *p));
static int xdr_opaque_decode __P((struct mbuf **ptr,u_char *buf,
int len));
@@ -670,6 +670,7 @@ static int setfs(addr, path, p)
}
#endif
+#if !defined(__rtems__)
static int getdec(ptr)
char **ptr;
{
@@ -683,7 +684,9 @@ static int getdec(ptr)
*ptr = p;
return(ret);
}
+#endif
+#if !defined(__rtems__)
static char *substr(a,b)
char *a,*b;
{
@@ -702,6 +705,7 @@ static char *substr(a,b)
}
return (0);
}
+#endif
static void printip(char *prefix,struct in_addr addr)
{
diff --git a/cpukit/libnetworking/rtems/rtems_bootp.c b/cpukit/libnetworking/rtems/rtems_bootp.c
index 76bb79170e..1bfdb11906 100644
--- a/cpukit/libnetworking/rtems/rtems_bootp.c
+++ b/cpukit/libnetworking/rtems/rtems_bootp.c
@@ -6,6 +6,7 @@
#include <rtems/error.h>
#include <sys/types.h>
#include <rtems/rtems_bsdnet.h>
+#include <rtems/rtems_bsdnet_internal.h>
/*
* Perform a BOOTP request
diff --git a/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h b/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h
index 6b748b3de5..d95730d7f8 100644
--- a/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h
+++ b/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h
@@ -51,6 +51,10 @@ extern void soconnwakeup (struct socket *so);
#define splimp() 0
#define splx(_s) do { (_s) = 0; } while(0)
+/* to avoid warnings */
+void *memcpy(void *dest, const void *src, size_t n);
+void *memset(void *s, int c, size_t n);
+
#define ovbcopy(f,t,n) bcopy(f,t,n)
#define copyout(f,t,n) (memcpy(t,f,n),0)
#define copyin(f,t,n) (memcpy(t,f,n),0)
diff --git a/cpukit/libnetworking/rtems/rtems_syscall.c b/cpukit/libnetworking/rtems/rtems_syscall.c
index acba1f8322..7e6210c091 100644
--- a/cpukit/libnetworking/rtems/rtems_syscall.c
+++ b/cpukit/libnetworking/rtems/rtems_syscall.c
@@ -659,13 +659,13 @@ rtems_bsdnet_close (rtems_libio_t *iop)
return 0;
}
-static int
+static ssize_t
rtems_bsdnet_read (rtems_libio_t *iop, void *buffer, unsigned32 count)
{
return recv (iop->data0, buffer, count, 0);
}
-static int
+static ssize_t
rtems_bsdnet_write (rtems_libio_t *iop, const void *buffer, unsigned32 count)
{
return send (iop->data0, buffer, count, 0);