summaryrefslogtreecommitdiffstats
path: root/freebsd/usr.bin
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-11-06 09:35:05 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-11-11 10:08:06 +0100
commit0a57e1db23218393483a356c07868413a45caeeb (patch)
treea2d1dd67f5b05a52b1f79f571c690ebcf299d775 /freebsd/usr.bin
parentChange license to BSD (diff)
downloadrtems-libbsd-0a57e1db23218393483a356c07868413a45caeeb.tar.bz2
Reduce divergence from FreeBSD sources
Diffstat (limited to 'freebsd/usr.bin')
-rw-r--r--freebsd/usr.bin/netstat/bpf.c6
-rw-r--r--freebsd/usr.bin/netstat/if.c10
-rw-r--r--freebsd/usr.bin/netstat/main.c7
-rw-r--r--freebsd/usr.bin/netstat/mbuf.c4
-rw-r--r--freebsd/usr.bin/netstat/route.c16
-rw-r--r--freebsd/usr.bin/netstat/unix.c8
6 files changed, 18 insertions, 33 deletions
diff --git a/freebsd/usr.bin/netstat/bpf.c b/freebsd/usr.bin/netstat/bpf.c
index a7b9e452..b429ed62 100644
--- a/freebsd/usr.bin/netstat/bpf.c
+++ b/freebsd/usr.bin/netstat/bpf.c
@@ -35,9 +35,7 @@ __FBSDID("$FreeBSD$");
#include <sys/socketvar.h>
#include <sys/sysctl.h>
#include <rtems/bsd/sys/param.h>
-#ifndef __rtems__
#include <sys/user.h>
-#endif /* __rtems__ */
#include <net/if.h>
#include <net/if_var.h>
@@ -62,7 +60,7 @@ bpf_pidname(pid_t pid)
{
#ifdef __rtems__
return "rtems";
-#else
+#else /* __rtems__ */
struct kinfo_proc newkp;
int error, mib[4];
size_t size;
@@ -78,7 +76,7 @@ bpf_pidname(pid_t pid)
return (strdup("??????"));
}
return (strdup(newkp.ki_comm));
-#endif
+#endif /* __rtems__ */
}
static void
diff --git a/freebsd/usr.bin/netstat/if.c b/freebsd/usr.bin/netstat/if.c
index cd383241..b39670e1 100644
--- a/freebsd/usr.bin/netstat/if.c
+++ b/freebsd/usr.bin/netstat/if.c
@@ -197,7 +197,7 @@ intpr(int interval1, u_long ifnetaddr, void (*pfunc)(char *))
#endif
#ifndef __rtems__
struct ipx_ifaddr ipx;
-#endif
+#endif /* __rtems__ */
} ifaddr;
u_long ifaddraddr;
u_long ifaddrfound;
@@ -387,14 +387,14 @@ intpr(int interval1, u_long ifnetaddr, void (*pfunc)(char *))
network_layer = 1;
break;
-#endif
+#endif /* __rtems__ */
#ifndef __rtems__
case AF_APPLETALK:
printf("atalk:%-12.12s ",atalk_print(sa,0x10) );
printf("%-11.11s ",atalk_print(sa,0x0b) );
break;
-#endif
+#endif /* __rtems__ */
case AF_LINK:
{
struct sockaddr_dl *sdl =
@@ -716,13 +716,13 @@ loop:
signalled = NO;
sigprocmask(SIG_SETMASK, &oldmask, NULL);
}
-#else
+#else /* __rtems__ */
oldmask = sigblock(sigmask(SIGALRM));
while (!signalled)
sigpause(0);
signalled = NO;
sigsetmask(oldmask);
-#endif
+#endif /* __rtems__ */
line++;
first = 0;
if (line == 21)
diff --git a/freebsd/usr.bin/netstat/main.c b/freebsd/usr.bin/netstat/main.c
index fcc40d5c..4c76b906 100644
--- a/freebsd/usr.bin/netstat/main.c
+++ b/freebsd/usr.bin/netstat/main.c
@@ -779,10 +779,6 @@ printproto(tp, name)
(*pr)(off, name, af, tp->pr_protocol);
}
-#ifdef __rtems__
-#define _POSIX2_LINE_MAX 128
-#endif
-
/*
* Read kernel memory, return 0 on success.
*/
@@ -790,9 +786,6 @@ int
kread(u_long addr, void *buf, size_t size)
{
char errbuf[_POSIX2_LINE_MAX];
-#ifdef __rtems__
- /* printf( "kread( %p to %p for %d)\n", (void *)addr, buf, size ); */
-#endif
if (kvmd == NULL) {
kvmd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf);
diff --git a/freebsd/usr.bin/netstat/mbuf.c b/freebsd/usr.bin/netstat/mbuf.c
index b06a1190..08633639 100644
--- a/freebsd/usr.bin/netstat/mbuf.c
+++ b/freebsd/usr.bin/netstat/mbuf.c
@@ -113,9 +113,9 @@ mbpr(void *kvmd, u_long mbaddr)
memstat_strerror(error));
goto out;
}
-#else
+#else /* __rtems__ */
;
-#endif
+#endif /* __rtems__ */
}
mtp = memstat_mtl_find(mtlp, ALLOCATOR_UMA, MBUF_MEM_NAME);
diff --git a/freebsd/usr.bin/netstat/route.c b/freebsd/usr.bin/netstat/route.c
index 4ffe329a..33374831 100644
--- a/freebsd/usr.bin/netstat/route.c
+++ b/freebsd/usr.bin/netstat/route.c
@@ -180,10 +180,10 @@ routepr(u_long rtree)
{
rtems_clock_get_uptime(&uptime);
}
-#else
+#else /* __rtems__ */
if (clock_gettime(CLOCK_UPTIME, &uptime) < 0)
err(EX_OSERR, "clock_gettime() failed");
-#endif
+#endif /* __rtems__ */
printf("Routing tables\n");
@@ -217,10 +217,6 @@ routepr(u_long rtree)
continue;
if (rnh == NULL)
continue;
-#ifdef __rtems__
- /* printf( "rnh %p %p\n", (void *)rnhp, (void *)rnh ); */
- /* We get a 1 here on some fields. Why? XXX */
-#endif
/* Read the rnh data. */
if (kget(rnh, head) != 0)
continue;
@@ -692,17 +688,17 @@ fmt_sockaddr(struct sockaddr *sa, struct sockaddr *mask, int flags)
cp = atalk_print(sa,11);
break;
}
-#endif
+#endif /* __rtems__ */
case AF_NETGRAPH:
{
#ifdef __rtems__
/* netgraph not supported yet */
err(EX_OSERR, "memory allocation failed");
-#else
+#else /* __rtems__ */
strlcpy(workbuf, ((struct sockaddr_ng *)sa)->sg_data,
sizeof(workbuf));
cp = workbuf;
-#endif
+#endif /* __rtems__ */
break;
}
@@ -1145,7 +1141,7 @@ ipx_phost(struct sockaddr *sa)
return(p);
}
-#endif
+#endif /* __rtems__ */
void
upHex(char *p0)
diff --git a/freebsd/usr.bin/netstat/unix.c b/freebsd/usr.bin/netstat/unix.c
index ada14c46..7a209ebc 100644
--- a/freebsd/usr.bin/netstat/unix.c
+++ b/freebsd/usr.bin/netstat/unix.c
@@ -53,9 +53,7 @@ __FBSDID("$FreeBSD$");
#include <sys/mbuf.h>
#include <sys/sysctl.h>
#include <sys/un.h>
-#ifndef __rtems__
#include <sys/unpcb.h>
-#endif /* __rtems__ */
#include <netinet/in.h>
@@ -196,7 +194,7 @@ fail:
#undef COPYOUT
#undef KREAD
}
-#endif
+#endif /* __rtems__ */
#ifndef __rtems__
void
@@ -247,7 +245,7 @@ unixpr(u_long count_off, u_long gencnt_off, u_long dhead_off, u_long shead_off)
free(buf);
}
}
-#endif
+#endif /* __rtems__ */
#ifndef __rtems__
static void
@@ -293,4 +291,4 @@ unixdomainpr(struct xunpcb *xunp, struct xsocket *so)
sa->sun_path);
putchar('\n');
}
-#endif
+#endif /* __rtems__ */