summaryrefslogtreecommitdiff
path: root/gdbsupport
diff options
context:
space:
mode:
authorRoland McGrath <mcgrathr@google.com>2022-03-01 16:03:58 -0800
committerRoland McGrath <mcgrathr@google.com>2022-03-03 11:21:36 -0800
commit8674f082e3f0d3f27ded5d93ebbd11cd702f5f04 (patch)
tree1e12f26e02b8e3909639f4ea7b4b675fb4ff5cfc /gdbsupport
parentdb120fb808dc24538e89b851d6dda1890aad5a1f (diff)
Avoid conflict with gnulib open/close macros.
On some systems, the gnulib configuration will decide to define open and/or close as macros to replace the POSIX C functions. This interferes with using those names in C++ class or namespace scopes. gdbsupport/ * event-pipe.cc (event_pipe::open): Renamed to ... (event_pipe::open_pipe): ... this. (event_pipe::close): Renamed to ... (event_pipe::close_pipe): ... this. * event-pipe.h (class event_pipe): Updated. gdb/ * inf-ptrace.h (async_file_open, async_file_close): Updated. gdbserver/ * gdbserver/linux-low.cc (linux_process_target::async): Likewise.
Diffstat (limited to 'gdbsupport')
-rw-r--r--gdbsupport/event-pipe.cc6
-rw-r--r--gdbsupport/event-pipe.h4
2 files changed, 5 insertions, 5 deletions
diff --git a/gdbsupport/event-pipe.cc b/gdbsupport/event-pipe.cc
index 2b56b2fac8..a1d34d5960 100644
--- a/gdbsupport/event-pipe.cc
+++ b/gdbsupport/event-pipe.cc
@@ -28,7 +28,7 @@
event_pipe::~event_pipe ()
{
if (is_open ())
- close ();
+ close_pipe ();
}
/* See event-pipe.h. */
@@ -45,7 +45,7 @@ event_pipe::open ()
if (fcntl (m_fds[0], F_SETFL, O_NONBLOCK) == -1
|| fcntl (m_fds[1], F_SETFL, O_NONBLOCK) == -1)
{
- close ();
+ close_pipe ();
return false;
}
@@ -55,7 +55,7 @@ event_pipe::open ()
/* See event-pipe.h. */
void
-event_pipe::close ()
+event_pipe::close_pipe ()
{
::close (m_fds[0]);
::close (m_fds[1]);
diff --git a/gdbsupport/event-pipe.h b/gdbsupport/event-pipe.h
index 50679e470e..9a41089774 100644
--- a/gdbsupport/event-pipe.h
+++ b/gdbsupport/event-pipe.h
@@ -34,10 +34,10 @@ public:
DISABLE_COPY_AND_ASSIGN (event_pipe);
/* Create a new pipe. */
- bool open ();
+ bool open_pipe ();
/* Close the pipe. */
- void close ();
+ void close_pipe ();
/* True if the event pipe has been opened. */
bool is_open () const