--- freem/src/sighnd.c 2025/03/24 00:34:30 1.4 +++ freem/src/sighnd.c 2025/04/30 20:03:09 1.10 @@ -1,5 +1,5 @@ /* - * $Id: sighnd.c,v 1.4 2025/03/24 00:34:30 snw Exp $ + * $Id: sighnd.c,v 1.10 2025/04/30 20:03:09 snw Exp $ * FreeM signal handlers * * @@ -24,6 +24,24 @@ * along with FreeM. If not, see . * * $Log: sighnd.c,v $ + * Revision 1.10 2025/04/30 20:03:09 snw + * Work on entryref parser + * + * Revision 1.9 2025/04/15 18:39:20 snw + * Remove extraneous CRLFs in logprintf calls + * + * Revision 1.8 2025/04/15 16:49:36 snw + * Make use of logprintf throughout codebase + * + * Revision 1.7 2025/04/10 01:24:38 snw + * Remove C++ style comments + * + * Revision 1.6 2025/03/24 04:15:25 snw + * Create dummy onwinch signal handler for OS/2 + * + * Revision 1.5 2025/03/24 00:38:40 snw + * Fix termios junk in sighnd.c + * * Revision 1.4 2025/03/24 00:34:30 snw * Fix termios junk in sighnd.c * @@ -70,10 +88,9 @@ #include "events.h" #include "jobtab.h" #include "shmmgr.h" +#include "log.h" - -void m_log (int, const char *); int pending_signal_type = -1; void sig_attach(int sig, void *handler) @@ -84,7 +101,7 @@ void sig_attach(int sig, void *handler) #if !defined(__AMIGA) sigaction (sig, &act, NULL); #else - //TODO: fill in for m68k-amigaos + /* TODO: fill in for m68k-amigaos */ #endif } @@ -116,7 +133,7 @@ void sig_init(void) } -#if !defined(MSDOS) +#if !defined(MSDOS) && !defined(__OS2__) void onwinch (void) { struct winsize ws; @@ -136,13 +153,20 @@ void onwinch (void) return; } +#else +void onwinch (void) +{ + sig_attach (SIGWINCH, &onwinch); + + return; +} #endif void onintr (void) { sig_attach (SIGINT, &onintr); /* restore handler */ - //printf ("\r\nSIGINT codptr = '%s'\r\n", codptr); + /* printf ("\r\nSIGINT codptr = '%s'\r\n", codptr); */ if (first_process) { job_request_stop (pid); @@ -169,10 +193,16 @@ void onintr (void) } - if (breakon) { + + + if (breakon) { merr_raise (INRPT); inrpt_after_async = TRUE; if (forsw) sigint_in_for = TRUE; + + if (usermode == 1) { + debug_mode = TRUE; + } } else { zcc = TRUE; @@ -276,8 +306,7 @@ void onhup (void) if (run_daemon == TRUE) { - fprintf (stderr, "freem: daemon received SIGHUP\r\n"); - m_log (1, "freem: daemon received SIGHUP"); + logprintf (FM_LOG_INFO, "environment: daemon received SIGHUP"); sig_attach (SIGHUP, &onhup); /* restore handler */