In a case open() returns 0 tty might be leaked. While 0 should be
stdin (and therefore is an unlikely return value from open()), it's
still the case that the test should be for non-negative return values
from open().
gdb/ChangeLog:
2021-05-11 Alexandra Hájková <ahajkova@redhat.com>
* inflow.c (new_tty): Do not leak tty.
* btrace.c (handle_pt_insn_events): Ignore status update enable
events.
+2021-05-11 Alexandra Hájková <ahajkova@redhat.com>
+
+ * inflow.c (new_tty): Do not leak tty.
+
+
2021-05-11 Simon Marchi <simon.marchi@polymtl.ca>
* arm-tdep.c (arm_record_data_proc_misc_ld_str): Fix
systems (SVR4 for example), this may cause a SIGTTOU, so temporarily
ignore SIGTTOU. */
tty = open ("/dev/tty", O_RDWR);
- if (tty > 0)
+ if (tty >= 0)
{
scoped_ignore_sigttou ignore_sigttou;