https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104767
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-11 branch has been updated by Eric Botcazou <ebotca...@gcc.gnu.org>: https://gcc.gnu.org/g:4c649dc71189f20ab8ed09b03a7353299f1022c8 commit r11-9691-g4c649dc71189f20ab8ed09b03a7353299f1022c8 Author: Pascal Obry <o...@adacore.com> Date: Thu Mar 24 11:30:05 2022 +0100 Properly reset the port handle when closing When the serial port is closed, we need to ensure that the port handle is properly reset for it to be detected as closed. gcc/ada/ PR ada/104767 * libgnat/g-sercom__mingw.adb (Close): Reset port handle to -1. * libgnat/g-sercom__linux.adb (Close): Likewise.