From dea8eefd6214e3ad5b54795fa958ab721d58710c Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Sat, 31 Jan 2004 19:45:13 +0000 Subject: bitkeeper revision 1.699 (401c05c9TV2zsaZ_e3zpy-zaKxCetw) timer.c, timer.h, sched.h: new file Many files: Rolf's new timer interface, plus various cleanups. --- tools/misc/Makefile | 4 ++-- tools/misc/xen_read_console.c | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'tools/misc') diff --git a/tools/misc/Makefile b/tools/misc/Makefile index 19d25b4748..597e68da17 100644 --- a/tools/misc/Makefile +++ b/tools/misc/Makefile @@ -16,7 +16,7 @@ all: $(TARGETS) install: all mkdir -p /usr/bin - cp -a $(INSTALL) /usr/bin + cp $(INSTALL) /usr/bin chmod 755 /usr/bin/xen-mkdevnodes chmod 755 /usr/bin/xen_nat_enable chmod 755 /usr/bin/xen-clone @@ -24,7 +24,7 @@ install: all dist: all mkdir -p ../../../install/bin - cp -a $(INSTALL) ../../../install/bin + cp $(INSTALL) ../../../install/bin chmod 755 ../../../install/bin/xen-mkdevnodes chmod 755 ../../../install/bin/xen_nat_enable chmod 755 ../../../install/bin/xen-clone diff --git a/tools/misc/xen_read_console.c b/tools/misc/xen_read_console.c index 766d24f6f3..1352de8a6f 100644 --- a/tools/misc/xen_read_console.c +++ b/tools/misc/xen_read_console.c @@ -11,9 +11,9 @@ int main(void) { - unsigned char buf[208]; + unsigned char buf[208], filtered[208]; struct sockaddr_in addr, from; - int fromlen = sizeof(from); + int fromlen = sizeof(from), i, j; int len, fd = socket(PF_INET, SOCK_DGRAM, 0); if ( fd < 0 ) @@ -46,7 +46,12 @@ int main(void) if ( buf[len-1] != '\n' ) { buf[len] = '\n'; len++; } buf[len] = '\0'; - printf("[%d] %s", ntohs(from.sin_port),buf); + for ( i = 0, j = 0; i < len; i++ ) + if ( (buf[i] == '\n') || (buf[i] == '\0') || + ((buf[i] >= 32) && (buf[i] <= 126)) ) + filtered[j++] = buf[i]; + + printf("[%d] %s", ntohs(from.sin_port), filtered); fromlen = sizeof(from); } -- cgit v1.2.3