aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ada/libgnat/g-sercom__linux.adb1
-rw-r--r--gcc/ada/libgnat/g-sercom__mingw.adb1
2 files changed, 2 insertions, 0 deletions
diff --git a/gcc/ada/libgnat/g-sercom__linux.adb b/gcc/ada/libgnat/g-sercom__linux.adb
index a2a64b1..73bbb69 100644
--- a/gcc/ada/libgnat/g-sercom__linux.adb
+++ b/gcc/ada/libgnat/g-sercom__linux.adb
@@ -382,6 +382,7 @@ package body GNAT.Serial_Communications is
begin
if Port.H /= -1 then
Res := close (int (Port.H));
+ Port.H := -1;
end if;
end Close;
diff --git a/gcc/ada/libgnat/g-sercom__mingw.adb b/gcc/ada/libgnat/g-sercom__mingw.adb
index aea78ae..d3301bd 100644
--- a/gcc/ada/libgnat/g-sercom__mingw.adb
+++ b/gcc/ada/libgnat/g-sercom__mingw.adb
@@ -70,6 +70,7 @@ package body GNAT.Serial_Communications is
begin
if Port.H /= -1 then
Success := CloseHandle (HANDLE (Port.H));
+ Port.H := -1;
if Success = Win32.FALSE then
Raise_Error ("error closing the port");