This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: RFA: Patch to ser-unix.c (When infinite equals 32K seconds)
- To: Andrew Cagney <ac131313 at cygnus dot com>
- Subject: Re: RFA: Patch to ser-unix.c (When infinite equals 32K seconds)
- From: Fernando Nasser <fnasser at cygnus dot com>
- Date: Wed, 25 Oct 2000 13:52:36 +0000
- CC: gdb-patches at sourceware dot cygnus dot com
- Organization: Red Hat Canada Ltd. - Toronto
- References: <39BEA383.1F5A2DE2@cygnus.com> <39F6DDBF.A26EED67@cygnus.com>
Andrew Cagney wrote:
>
> Fernando Nasser wrote:
> >
> > This patch prevents the infinite read block to terminate after 32K seconds...
> >
> > 2000-09-12 Fernando Nasser <fnasser@cygnus.com>
> >
> > * ser-unix.c (do_unix_readchar): Prevent infinite read wait to be
> > interrupted after 32K seconds.
> >
> > --
> > Fernando Nasser
> > Red Hat - Toronto E-Mail: fnasser@cygnus.com
> > 2323 Yonge Street, Suite #300 Tel: 416-482-2661 ext. 311
> > Toronto, Ontario M4P 2C9 Fax: 416-482-6299
> >
> > Index: ser-unix.c
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/ser-unix.c,v
> > retrieving revision 1.5
> > diff -c -p -r1.5 ser-unix.c
> > *** ser-unix.c 2000/07/30 01:48:27 1.5
> > --- ser-unix.c 2000/09/12 15:57:11
> > *************** do_unix_readchar (serial_t scb, int time
> > *** 927,933 ****
> > }
> >
> > status = ser_unix_wait_for (scb, delta);
> > ! timeout -= delta;
> >
> > /* If we got a character or an error back from wait_for, then we can
> > break from the loop before the timeout is completed. */
> > --- 927,933 ----
> > }
> >
> > status = ser_unix_wait_for (scb, delta);
> > ! timeout = (timeout <= 0) ? timeout : (timeout - delta);
>
> Can it be written as:
>
> if (timeout > 0)
> timeout -= delta;
>
> (correct?) it is easier to read than that ``?'' expression :-).
> Otherwize approved.
>
> Andrew
Sure. I will make the change and commit.
P.S.: (I copied this line from a previous version of the file almost verbatim;
should have rewritten it.)
--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9