neat function, havnt seen that one before...
but that doesnt solve the problem when waiting on select() and a signal happens.
I thought of something while staring at the wall... would it be that im not handing the execpt read list in select(), so when a user tries to CTRL+C out, its trying to write the the except read list, but since its null, it is crashing?
i will have to do some studying.
Thanks again for the input, and any other input you may be able to give.
andy
The atexit() function adds the function func to a list of functions to be called without parameters on normal termination of the program. Normal termination occurs by either a call to exit() or a return from main(). The functions are called in the reverse order of their registration.
ok i feel like a doofus...
It was catching the signals in release mode.. the only time it would "crash" was in debug. And the msg was telling me "1st chance exception - control-c"
So, that problem is solved. but a new one has arrived. Does anyone know how to disable 1st chance exceptions in debug mode using microsoft visual C++ 6.0
I have _CrtSetDbgFlag() enabled and would like to see the memory leaks, but if i hit ctrl+c, it gives me that message and quits. i need it to cleanly exit as it does in release mode.
boy, not my day! i am zero for three today... you can just hit "ok" the the exception and the compiler just asks if you want your program to handle it anyway.
lol.. ok i am good to go. sometimes it just helps to type stuff out to other people
On Unix, You could try catching sighup, sigint or sigterm. One of them might equate to ctrl-C. sigkill or kill -9 isn't catchable. If ctrl-c equates to that, then you cannot catch it. The OS has been made this way so it is possible to kill rogue processes and the rogue processes cannot trap that signal to stop themselves from being killed.
On Windows, Ctrl-C is copy, Ctrl-X is cut, Ctrl-V is paste so you can probably catch it but it won't do what you want. In windows programming: you could try trapping the WM_KEYDOWN. The Ctrl-Break sequence is called VK_CANCEL.
Bookmarks