diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2016-07-04 12:43:01 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2016-07-04 12:43:01 +0200 |
commit | ae4c4d53b46fb246534cc9de41d230610b50d99a (patch) | |
tree | 1a22b6fe19378d9cc9e5ce07092406bd0b7ab155 /gcc/ada/g-sercom-mingw.adb | |
parent | c70cf4f8eb5bf8623e0f89eef6aabf308ef04c1b (diff) | |
download | gcc-ae4c4d53b46fb246534cc9de41d230610b50d99a.zip gcc-ae4c4d53b46fb246534cc9de41d230610b50d99a.tar.gz gcc-ae4c4d53b46fb246534cc9de41d230610b50d99a.tar.bz2 |
[multiple changes]
2016-07-04 Olivier Hainque <hainque@adacore.com>
* g-sercom-mingw.adb (Set): Fix port configuration for the
non-blocking + null-timeout case, request of immediate return.
2016-07-04 Ed Schonberg <schonberg@adacore.com>
* sem_ch6.adb (Is_Non_Overriding_Operation): Add guard to test
of generic parent type when operation is a parameterless function
that may dispatch on result.
From-SVN: r237970
Diffstat (limited to 'gcc/ada/g-sercom-mingw.adb')
-rw-r--r-- | gcc/ada/g-sercom-mingw.adb | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/gcc/ada/g-sercom-mingw.adb b/gcc/ada/g-sercom-mingw.adb index 292ca8f..ec3beaa 100644 --- a/gcc/ada/g-sercom-mingw.adb +++ b/gcc/ada/g-sercom-mingw.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2007-2013, AdaCore -- +-- Copyright (C) 2007-2016, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -248,11 +248,27 @@ package body GNAT.Serial_Communications is Raise_Error ("cannot set comm state"); end if; - -- Set the timeout status + -- Set the timeout status, to honor our spec with respect to + -- read timeouts. Always disconnect write timeouts. if Block then + + -- Blocking reads - no timeout at all + Com_Time_Out := (others => 0); + elsif Timeout = 0.0 then + + -- Non-blocking reads and null timeout - immediate return + -- with what we have - set ReadIntervalTimeout to MAXDWORD. + + Com_Time_Out := + (ReadIntervalTimeout => DWORD'Last, + others => 0); else + + -- Non-blocking reads with timeout - set total read timeout + -- accordingly + Com_Time_Out := (ReadTotalTimeoutConstant => DWORD (1000 * Timeout), others => 0); |