From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 262BE3858D3C; Wed, 16 Aug 2023 14:11:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 262BE3858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1692195065; bh=C+8bwW9Q6mQd+EnV/Rq4HXvEkS7pR5NwvdloUcgZcfU=; h=From:To:Subject:Date:From; b=Ea5YFKxpZ2NR1DEoI9Ai9uTNXlZlcnhmLmqZf4Hs8vGBHYyhN5bCYDolHFV4nf+7R 7Oom2B2Ee3FDGVeYUSBpHjhAVXUvDOF0lTpVH28i8OpO8VUoJa0S9m94nQRnSHfRzu Q/IU2n4TMsj2KCnk+cnRTx9/1ig96RKON9DeO+10= From: "tromey at sourceware dot org" To: gdb-prs@sourceware.org Subject: [Bug remote/30770] New: serial.c does not preserve errno correctly Date: Wed, 16 Aug 2023 14:11:04 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: remote X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tromey at sourceware dot org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30770 Bug ID: 30770 Summary: serial.c does not preserve errno correctly Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: remote Assignee: unassigned at sourceware dot org Reporter: tromey at sourceware dot org Target Milestone: --- Internally at AdaCore there is a test that randomly fails. The error message differs, though: Remote communication error. Target disconnected.: Arg list too long. Remote communication error. Target disconnected.: No error. Remote communication error. Target disconnected.: Not a directory. Looking into this, it seems to me that serial.c doesn't always preserve the correct errno, but remote.c seems to assume that it does. For example, ser-base.c:generic_readchar does a lot of work after do_readchar fails. --=20 You are receiving this mail because: You are on the CC list for the bug.=