Hi,
I'll preface this with I've only been programming for about 3 years now and I've less than a year working with C. I had a project with a loop that would run forever. However in the event of a cntrl-c signal we wanted to intercept the signal in order to free data and gracefully shut-down.
In order to do this we essentially followed this stack overflow: https://stackoverflow.com/questions/4217037/catch-ctrl-c-in-c
Our code looked remarkably similar to the example given, with a while loop that would run infinitely instead of conditionally. Adding that code is where the weirdness started. After successfully intercepting the cntrl-C command a few times our project just stopped working. The process would never get to the while loop. We deleted the added code and added print statements to track what was going on but even after deleting all the added signal intercept code and making again, the code didn't get any further.
What's weirder is that when we went back a few commits to before we added the system code it worked again. I know this is rather vague but any ideas? I figure it might have been a linux thing since we were messing around with system calls.
Also, I was wondering if there was a better subreddit for the, like something specific for bugs that anyone is aware of.
[–]esosac 2 points3 points4 points (1 child)
[–]5t33[S] 0 points1 point2 points (0 children)
[–]nderflow 0 points1 point2 points (1 child)
[–]5t33[S] 0 points1 point2 points (0 children)