From: Steve Langasek <vorlon@debian.org>
Subject: informational messages should go to stdout, only errors to stderr

---
--- a/input.c
+++ b/input.c
@@ -94,7 +94,7 @@ int device_open(int nr, int verbose)
 		return -1;
 	}
 	if (verbose)
-		fprintf(stderr,"%s\n",filename);
+		printf("%s\n",filename);
 
 	return fd;
 }
@@ -108,7 +108,7 @@ void device_info(int fd)
 
 	rc = ioctl(fd,EVIOCGID,&id);
 	if (rc >= 0)
-		fprintf(stderr,
+		printf(
 			"   bustype : %s\n"
 			"   vendor  : 0x%x\n"
 			"   product : 0x%x\n"
@@ -117,23 +117,23 @@ void device_info(int fd)
 			id.vendor, id.product, id.version);
 	rc = ioctl(fd,EVIOCGNAME(sizeof(buf)),buf);
 	if (rc >= 0)
-		fprintf(stderr,"   name    : \"%.*s\"\n",rc,buf);
+		printf("   name    : \"%.*s\"\n",rc,buf);
 	rc = ioctl(fd,EVIOCGPHYS(sizeof(buf)),buf);
 	if (rc >= 0)
-		fprintf(stderr,"   phys    : \"%.*s\"\n",rc,buf);
+		printf("   phys    : \"%.*s\"\n",rc,buf);
 	rc = ioctl(fd,EVIOCGUNIQ(sizeof(buf)),buf);
 	if (rc >= 0)
-		fprintf(stderr,"   uniq    : \"%.*s\"\n",rc,buf);
+		printf("   uniq    : \"%.*s\"\n",rc,buf);
 	rc = ioctl(fd,EVIOCGBIT(0,sizeof(bits)),bits);
 	if (rc >= 0) {
-		fprintf(stderr,"   bits ev :");
+		printf("   bits ev :");
 		for (bit = 0; bit < rc*8 && bit < EV_MAX; bit++) {
 			if (test_bit(bit,bits))
-				fprintf(stderr," %s", EV_NAME[bit]);
+				printf(" %s", EV_NAME[bit]);
 		}
-		fprintf(stderr,"\n");
+		printf("\n");
 	}
-	fprintf(stderr,"\n");
+	printf("\n");
 }
 
 /* ------------------------------------------------------------------ */
@@ -145,11 +145,11 @@ void print_event(struct input_event *eve
 
 	t = event->time.tv_sec;
 	strftime(ts,sizeof(ts),"%H:%M:%S",localtime(&t));
-	fprintf(stderr,"%s.%06ld: %s",ts,event->time.tv_usec,
+	printf("%s.%06ld: %s",ts,event->time.tv_usec,
 		EV_NAME[event->type]);
 	switch (event->type) {
 	case EV_KEY:
-		fprintf(stderr," %s %s",
+		printf(" %s %s",
 			ev_type_name(EV_KEY, event->code),
 			event->value ? "pressed" : "released");
 		break;
@@ -160,14 +160,14 @@ void print_event(struct input_event *eve
 	case EV_SND:
 	case EV_REP:
 	case EV_SW:
-		fprintf(stderr," %s %d",
+		printf(" %s %d",
 			ev_type_name(event->type, event->code), event->value);
 		break;
 	default:
-		fprintf(stderr," code=%u value=%d",
+		printf(" code=%u value=%d",
 			(unsigned int)event->code, event->value);
 	}
-	fprintf(stderr,"\n");
+	printf("\n");
 }
 
 /* ---------------------------------------------------------------------
--- a/input-send.c
+++ b/input-send.c
@@ -44,7 +44,7 @@ static void conn_new(void)
 			    conn->peerhost,INET6_ADDRSTRLEN,
 			    conn->peerserv,32,
 			    NI_NUMERICHOST | NI_NUMERICSERV);
-		fprintf(stderr,"connect from [%s]\n",conn->peerhost);
+		printf("connect from [%s]\n",conn->peerhost);
 	}
 	fcntl(conn->socket,F_SETFL,O_NONBLOCK);
 
@@ -55,7 +55,7 @@ static void conn_new(void)
 static void conn_del(struct connection  *conn)
 {
 	if (tcp_verbose)
-		fprintf(stderr,"connection from [%s] closed\n",conn->peerhost);
+		printf("connection from [%s] closed\n",conn->peerhost);
 	close(conn->socket);
 	list_del(&conn->list);
 	free(conn);
--- a/input-recv.c
+++ b/input-recv.c
@@ -62,7 +62,7 @@ int main(int argc, char *argv[])
 		
 		rc = read(sock,&ev,sizeof(ev));
 		if (rc != sizeof(ev)) {
-			fprintf(stderr,"read ret=%d (expected %d), errno=%s\n",
+			printf("read ret=%d (expected %d), errno=%s\n",
 				rc,(int)sizeof(ev),strerror(errno));
 			exit(1);
 		}
--- a/input-kbd.c
+++ b/input-kbd.c
@@ -79,7 +79,7 @@ static struct kbd_map* kbd_map_read(int
 			map->keys++;
 	}
 	if (map->keys) {
-		fprintf(stderr,"map: %d keys, size: %d/%d\n",
+		printf("map: %d keys, size: %d/%d\n",
 			map->keys, map->size, map->alloc);
 		return map;
 	} else {
@@ -95,7 +95,7 @@ static int kbd_map_write(int fh, struct
 	for (i = 0; i < map->size; i++) {
 		rc = ioctl(fh, EVIOCSKEYCODE, &map->map[i]);
 		if (0 != rc) {
-			fprintf(stderr,"ioctl EVIOCSKEYCODE(%d,%d): %s\n",
+			printf("ioctl EVIOCSKEYCODE(%d,%d): %s\n",
 				map->map[i].scancode,map->map[i].keycode,
 				strerror(errno));
 			return -1;
@@ -158,8 +158,8 @@ static int kbd_map_parse(FILE *fp, struc
 		else
 			entry.keycode = i;
 
-		fprintf(stderr,"set: ");
-		kbd_key_print(stderr,entry.scancode,entry.keycode);
+		printf("set: ");
+		kbd_key_print(stdout,entry.scancode,entry.keycode);
 		map->map[entry.scancode] = entry;
 	}
 	return 0;
@@ -179,9 +179,9 @@ static void kbd_print_bits(int fd)
 		if (!test_bit(bit,bits))
 			continue;
 		if (EV_TYPE_NAME[EV_KEY][bit]) {
-			fprintf(stderr,"bits: %s\n", EV_TYPE_NAME[EV_KEY][bit]);
+			printf("bits: %s\n", EV_TYPE_NAME[EV_KEY][bit]);
 		} else {
-			fprintf(stderr,"bits: unknown [%d]\n", bit);
+			printf("bits: unknown [%d]\n", bit);
 		}
 	}
 }
@@ -206,7 +206,7 @@ static int set_kbd(int fd, unsigned int
 
 	map = kbd_map_read(fd, protocol_version);
 	if (NULL == map) {
-		fprintf(stderr,"device has no map\n");
+		printf("device has no map\n");
 		close(fd);
 		return -1;
 	}
@@ -216,7 +216,7 @@ static int set_kbd(int fd, unsigned int
 	else {
 		fp = fopen(mapfile,"r");
 		if (NULL == fp) {
-			fprintf(stderr,"open %s: %s\n",mapfile,strerror(errno));
+			printf("open %s: %s\n",mapfile,strerror(errno));
 			close(fd);
 			return -1;
 		}
