| delorie.com/archives/browse.cgi | search |
| From: | Marcus Rohrmoser <Marcus DOT Rohrmoser AT lrz DOT de> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: Stopping Ctrl C breaking program |
| Date: | Fri, 05 Mar 1999 16:32:27 +0100 |
| Organization: | Leibniz Rechenzentrum Muenchen |
| Lines: | 22 |
| Distribution: | world |
| Message-ID: | <36DFF90B.BD2C2B36@lrz.de> |
| References: | <36dbee3d DOT 741660 AT 158 DOT 152 DOT 254 DOT 68> |
| NNTP-Posting-Host: | sun5.lrz-muenchen.de |
| Mime-Version: | 1.0 |
| X-Mailer: | Mozilla 4.5 [en] (X11; I; SunOS 5.5.1 sun4m) |
| X-Accept-Language: | en, de-DE |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
Maybe catching the signal 'SIGINT' can help.
Define a dummy-function first, e.g.:
void SigDummy(int sig) {
signal(sig, SigDummy); /* reinstall the handler */
}
And install the handler:
main() {
...
signal(SIGINT, SigDummy); // install a signal handler
...
}
Don't forget to include <signal.h>
Maybe there's a simpler way, but anyway, this should work.
Marcus
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |