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: Fernando Nasser <fnasser at cygnus dot com>
- Subject: Re: RFA: Patch to ser-unix.c (When infinite equals 32K seconds)
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Thu, 26 Oct 2000 00:18:55 +1100
- Cc: gdb-patches at sourceware dot cygnus dot com
- References: <39BEA383.1F5A2DE2@cygnus.com>
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