Not just printing the same message 3 times. Tagging it (Error or Warning) and specify the faulty ioctl.
$ i8kctl Warning: ioctl I8K_BIOS_VERSION failed: Invalid argument Warning: ioctl I8K_GET_SPEED failed: Invalid argument Warning: ioctl I8K_GET_SPEED failed: Invalid argument 1.0 (null) 6WNHA 44 2 2 -1 -1 0 0 $ --- i8kctl.c.orig 2009-08-22 14:27:09.000000000 +0100 +++ i8kctl.c 2009-09-17 21:05:10.000000000 +0100 @@ -37,6 +37,7 @@ int rc; if ((rc=ioctl(i8k_fd, I8K_BIOS_VERSION, &args)) < 0) { + perror("Warning: ioctl I8K_BIOS_VERSION failed"); return NULL; } @@ -55,6 +56,7 @@ int rc; if ((rc=ioctl(i8k_fd, I8K_MACHINE_ID, &args)) < 0) { + perror("Warning: ioctl I8K_MACHINE_ID failed"); return NULL; } @@ -70,6 +72,7 @@ args[0] = fan; args[1] = speed; if ((rc=ioctl(i8k_fd, I8K_SET_FAN, &args)) < 0) { + perror("Error: ioctl I8K_SET_FAN failed"); return rc; } @@ -84,6 +87,7 @@ args[0] = fan; if ((rc=ioctl(i8k_fd, I8K_GET_FAN, &args)) < 0) { + perror("Warning: ioctl I8K_GET_FAN failed"); return rc; } @@ -98,6 +102,7 @@ args[0] = fan; if ((rc=ioctl(i8k_fd, I8K_GET_SPEED, &args)) < 0) { + perror("Warning: ioctl I8K_GET_SPEED failed"); return rc; } @@ -111,6 +116,7 @@ int rc; if ((rc=ioctl(i8k_fd, I8K_GET_TEMP, &args)) < 0) { + perror("Warning: ioctl I8K_GET_TEMP failed"); return rc; } @@ -124,6 +130,7 @@ int rc; if ((rc=ioctl(i8k_fd, I8K_POWER_STATUS, &args)) < 0) { + perror("Warning: ioctl I8K_POWER_STATUS failed"); return rc; } @@ -137,6 +144,7 @@ int rc; if ((rc=ioctl(i8k_fd, I8K_FN_STATUS, &args)) < 0) { + perror("Warning: ioctl I8K_FN_STATUS failed"); return rc; } -- sobtw...@sdf.lonestar.org SDF Public Access UNIX System - http://sdf.lonestar.org -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org