From 61d79e9e2361811615520137434500add45efe49 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Tue, 10 Jul 2007 12:59:45 +0000 Subject: [PATCH] - improve signal handling a bit (#246465) --- minicom-2.2-sigs.patch | 35 +++++++++++++++++++++++++++++++++++ minicom.spec | 7 ++++++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 minicom-2.2-sigs.patch diff --git a/minicom-2.2-sigs.patch b/minicom-2.2-sigs.patch new file mode 100644 index 0000000..573ca31 --- /dev/null +++ b/minicom-2.2-sigs.patch @@ -0,0 +1,35 @@ +--- minicom-2.2/src/minicom.c.sigs 2007-07-10 13:52:51.000000000 +0200 ++++ minicom-2.2/src/minicom.c 2007-07-10 14:48:52.000000000 +0200 +@@ -107,11 +107,17 @@ static void hangsig(int sig) + /*ARGSUSED*/ + static void shjump(int dummy /* __attribute__((unused)) */) + { ++ sigset_t ss, oldss; ++ + dummy = dummy; /* avoid compiler warning, should be optimized away... */ + wleave(); + signal(SIGTSTP, SIG_DFL); ++ sigemptyset(&ss); ++ sigaddset(&ss, SIGTSTP); ++ sigprocmask(SIG_UNBLOCK, &ss, &oldss); + fputs(_("Suspended. Type \"fg\" to resume.\n"),stdout); + kill(getpid(), SIGTSTP); ++ sigprocmask(SIG_SETMASK, &oldss, NULL); + signal(SIGTSTP, shjump); + wreturn(); + if (use_status) +@@ -1524,6 +1530,14 @@ dirty_goto: + do_log("%s", _("Quit without reset while online.")); + m_hupcl(portfd, 0); + } ++ ++ signal(SIGTERM, SIG_IGN); ++ signal(SIGHUP, SIG_IGN); ++#ifdef SIGTSTP ++ signal(SIGTSTP, SIG_DFL); ++#endif ++ signal(SIGQUIT, SIG_DFL); ++ + if (capfp != (FILE *)0) + fclose(capfp); + wclose(us, 0); diff --git a/minicom.spec b/minicom.spec index f87766d..370de89 100644 --- a/minicom.spec +++ b/minicom.spec @@ -1,7 +1,7 @@ Summary: A text-based modem control and terminal emulation program Name: minicom Version: 2.2 -Release: 1%{?dist} +Release: 2%{?dist} URL: http://alioth.debian.org/projects/minicom/ License: GPL Group: Applications/Communications @@ -22,6 +22,7 @@ Patch7: minicom-2.2-gotodir.patch Patch8: minicom-2.2-rh.patch Patch9: minicom-2.2-esc.patch Patch10: minicom-2.2-staticbuf.patch +Patch11: minicom-2.2-sigs.patch %description Minicom is a simple text-based modem control and terminal emulation @@ -41,6 +42,7 @@ language, and other features. %patch8 -p1 -b .rh %patch9 -p1 -b .esc %patch10 -p1 -b .staticbuf +%patch11 -p1 -b .sigs %build %configure @@ -69,6 +71,9 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man1/* %changelog +* Tue Jul 10 2007 Miroslav Lichvar 2.2-2 +- improve signal handling a bit (#246465) + * Fri Mar 09 2007 Miroslav Lichvar 2.2-1 - update to 2.2 - handle filenames with spaces (#98655)