diff options
Diffstat (limited to 'tools/misc')
-rw-r--r-- | tools/misc/Makefile | 4 | ||||
-rw-r--r-- | tools/misc/xen_read_console.c | 11 |
2 files changed, 10 insertions, 5 deletions
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); } |