diff options
author | Pedro Alves <pedro@palves.net> | 2022-05-16 10:11:15 +0100 |
---|---|---|
committer | Pedro Alves <pedro@palves.net> | 2022-05-16 19:54:20 +0100 |
commit | 36a5b3705352f228cdd14a7f9d5e85177fad034c (patch) | |
tree | b1f4da15c5794bcc10204d1482a766730528476f /gdbsupport/scoped_ignore_signal.h | |
parent | e90601a4f1af82ff5350797ddc54e24efd731535 (diff) | |
download | gdb-36a5b3705352f228cdd14a7f9d5e85177fad034c.zip gdb-36a5b3705352f228cdd14a7f9d5e85177fad034c.tar.gz gdb-36a5b3705352f228cdd14a7f9d5e85177fad034c.tar.bz2 |
gdbsupport/event-loop.cc: simplify !HAVE_POLL paths
gdbsupport/event-loop.cc throughout handles the case of use_poll being
true on a system where HAVE_POLL is not defined, by calling
internal_error if that situation ever happens.
Simplify this by moving the "use_poll" global itself under HAVE_POLL,
so that it's way more unlikely to ever end up in such a situation.
Then, move the code that checks the value of use_poll under HAVE_POLL
too, and remove the internal_error calls. Like, from:
if (use_poll)
{
#ifdef HAVE_POLL
// poll code
#else
internal_error (....);
#endif /* HAVE_POLL */
}
else
{
// select code
}
to
#ifdef HAVE_POLL
if (use_poll)
{
// poll code
}
else
#endif /* HAVE_POLL */
{
// select code
}
While at it, make use_poll be a bool. The current code is using
unsigned char most probably to save space, but I don't think it really
matters here.
Co-Authored-By: Youling Tang <tangyouling@loongson.cn>
Change-Id: I0dd74fdd4d393ccd057906df4cd75e8e83c1cdb4
Diffstat (limited to 'gdbsupport/scoped_ignore_signal.h')
0 files changed, 0 insertions, 0 deletions