From: Momchil Velikov <velco@fadata.bg>
To: Benjamin Herrenschmidt <bh40@calva.net>
Cc: Michael Schmitz <schmitz@opal.biophys.uni-duesseldorf.de>,
linuxppc-dev@lists.linuxppc.org
Subject: Re: serial on lombard
Date: Thu, 14 Oct 1999 17:53:43 +0300 [thread overview]
Message-ID: <3805EE77.DFC69FCA@fadata.bg> (raw)
In-Reply-To: 19991014163425.001988@mailhost.mipsys.com
Benjamin Herrenschmidt wrote:
> --- minicom-1.82.orig/src/main.c Thu Aug 27 00:54:16 1998
> +++ minicom-1.82/src/main.c Thu Oct 14 16:20:00 1999
> @@ -158,7 +158,7 @@
> if (setjmp(albuf) == 0) {
> portfd = -1;
> signal(SIGALRM, get_alrm);
> - alarm(2);
> + alarm(4);
> #if defined(O_NDELAY) && defined(F_SETFL)
> portfd = open(dial_tty, O_RDWR|O_NDELAY);
> if (portfd >= 0){
I think the code should be as follows:
signal( SIGALRM, a_signal_handler_which_just_returns );
alarm(4);
portfd = open( dial_tty, O_RDWR|O_NONBLOCK);
alarm(0);
if( portfd >= 0 ) {
...
In old code (and in the patched one too) there is a race condition
between clearing the alarm and signal delivery. A sequence similar
to the above one relies only on the return value of open().
Regards,
-velco
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
next prev parent reply other threads:[~1999-10-14 14:53 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-10-14 19:12 serial on lombard Mario Scarpa
1999-10-14 11:06 ` Benjamin Herrenschmidt
1999-10-14 11:19 ` Michael Schmitz
1999-10-14 11:31 ` Momchil Velikov
1999-10-14 12:35 ` Chris Ridd
1999-10-14 13:06 ` Benjamin Herrenschmidt
1999-10-14 13:43 ` Momchil Velikov
1999-10-14 14:21 ` Michael Schmitz
1999-10-14 14:34 ` Benjamin Herrenschmidt
1999-10-14 14:53 ` Momchil Velikov [this message]
1999-10-14 16:10 ` Michael Schmitz
1999-10-15 7:26 ` Momchil Velikov
1999-10-14 16:00 ` Michael Schmitz
1999-10-14 16:10 ` Benjamin Herrenschmidt
1999-10-14 17:41 ` Michael Schmitz
1999-10-15 4:12 ` Mario Scarpa
1999-10-15 8:33 ` Benjamin Herrenschmidt
1999-10-15 20:17 ` Mario Scarpa
1999-10-15 8:42 ` Michael Schmitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3805EE77.DFC69FCA@fadata.bg \
--to=velco@fadata.bg \
--cc=bh40@calva.net \
--cc=linuxppc-dev@lists.linuxppc.org \
--cc=schmitz@opal.biophys.uni-duesseldorf.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).