castvoid / xserve-frontpanel

A project to re-implement the daemon controlling the Xserve front panel CPU activity LED
MIT License
22 stars 4 forks source link

Turn off LEDs on quit #3

Open ryandesign opened 4 years ago

ryandesign commented 4 years ago

Thanks for this. It's really nice to see the LEDs working again after all these years.

When I Control-C hwmond to end it, the LEDs stay on. Might it be possible to turn them all off on quit instead? That way they wouldn't appear "stuck".

mav2287 commented 4 years ago

It has been a while since I worked on a C program for the terminal, but it looks like the information on how to do this can be found here. https://www.geeksforgeeks.org/write-a-c-program-that-doesnt-terminate-when-ctrlc-is-pressed/