diff --git a/README.md b/README.md index 1e78bdf..c86ead8 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +[![Build Status](https://build.jcktrue.dk/api/badges/jct/ledcontroller-3bit/status.svg)](https://build.jcktrue.dk/jct/ledcontroller-3bit) # ledcontroller-3bit # A Linux command line utility to control usb mail notifiers identified as: @@ -27,9 +28,8 @@ For example the script `mled-cputemp` will make it respond to your CPU's tempera $ sudo rm /usr/bin/ledcontroller -### Have fun: ### +### Have fun ### -Take a look inside the _scripts_ directory. ## Requisites: ## diff --git a/main.c b/main.c index 00e2364..81f9340 100644 --- a/main.c +++ b/main.c @@ -97,22 +97,22 @@ int main(int argc, char **argv) } else if (strcmp(argv[1], "white") == 0) { code = 7; } else { - printf("invalid color\n"); + puts("Invalid color"); return -1; } libusb_init(NULL); devh = libusb_open_device_with_vid_pid(NULL, VID, PID); if (devh == NULL) { - printf("not found\n"); + puts("Device not found"); return -1; } if (libusb_kernel_driver_active(devh, 0)) { - printf("detach from kernel\n"); + puts("Detach driver from kernel"); ret = libusb_detach_kernel_driver(devh, 0); if (ret < 0) { - printf("can't detach\n"); + puts("Could not detach driver"); return -1; } } @@ -128,7 +128,8 @@ int main(int argc, char **argv) libusb_claim_interface(devh, 0); ret = libusb_interrupt_transfer(devh, 0x2, data, 5, &dummy, 0); if (ret < 0) { - perror("error"); + perror("libusb error"); + return -1; }