- improve signal handling a bit (#246465)

This commit is contained in:
Miroslav Lichvar 2007-07-10 12:59:45 +00:00
parent 0f0e704dc8
commit 61d79e9e23
2 changed files with 41 additions and 1 deletions

35
minicom-2.2-sigs.patch Normal file
View File

@ -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);

View File

@ -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 <mlichvar@redhat.com> 2.2-2
- improve signal handling a bit (#246465)
* Fri Mar 09 2007 Miroslav Lichvar <mlichvar@redhat.com> 2.2-1
- update to 2.2
- handle filenames with spaces (#98655)