[RFC,05/17] Remove gdb_usleep.c

Message ID 20190224165153.5062-6-tom@tromey.com
State New
Headers show
Series
  • Merge event loop implementations
Related show

Commit Message

Tom Tromey Feb. 24, 2019, 4:51 p.m.
I noticed that gdb_usleep is unused, so this patch removes it.

gdb/ChangeLog
2019-02-24  Tom Tromey  <tom@tromey.com>

	* Makefile.in (COMMON_SFILES): Remove gdb_usleep.c.
	(HFILES_NO_SRCDIR): Remove gdb_usleep.h.
	* gdb_usleep.h: Remove.
	* gdb_usleep.c: Remove.
	* utils.c: Don't include gdb_usleep.h.
---
 gdb/ChangeLog    |  8 ++++++++
 gdb/Makefile.in  |  2 --
 gdb/gdb_usleep.c | 39 ---------------------------------------
 gdb/gdb_usleep.h | 30 ------------------------------
 gdb/utils.c      |  1 -
 5 files changed, 8 insertions(+), 72 deletions(-)
 delete mode 100644 gdb/gdb_usleep.c
 delete mode 100644 gdb/gdb_usleep.h

-- 
2.17.2

Comments

Pedro Alves Sept. 26, 2019, 2:02 p.m. | #1
On 2/24/19 4:51 PM, Tom Tromey wrote:
> I noticed that gdb_usleep is unused, so this patch removes it.

> 

> gdb/ChangeLog

> 2019-02-24  Tom Tromey  <tom@tromey.com>

> 

> 	* Makefile.in (COMMON_SFILES): Remove gdb_usleep.c.

> 	(HFILES_NO_SRCDIR): Remove gdb_usleep.h.

> 	* gdb_usleep.h: Remove.

> 	* gdb_usleep.c: Remove.

> 	* utils.c: Don't include gdb_usleep.h.


Indeed, I noticed this too recently.  You could go ahead and
merge this one, get it out of the way.

Thanks,
Pedro Alves
Tom Tromey Sept. 26, 2019, 2:43 p.m. | #2
>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:


Pedro> On 2/24/19 4:51 PM, Tom Tromey wrote:
>> I noticed that gdb_usleep is unused, so this patch removes it.

>> 

>> gdb/ChangeLog

>> 2019-02-24  Tom Tromey  <tom@tromey.com>

>> 

>> * Makefile.in (COMMON_SFILES): Remove gdb_usleep.c.

>> (HFILES_NO_SRCDIR): Remove gdb_usleep.h.

>> * gdb_usleep.h: Remove.

>> * gdb_usleep.c: Remove.

>> * utils.c: Don't include gdb_usleep.h.


Pedro> Indeed, I noticed this too recently.  You could go ahead and
Pedro> merge this one, get it out of the way.

Thanks, I'm going to check it in momentarily.

Tom

Patch

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 5614cc3386c..61b0b9d01bd 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -1031,7 +1031,6 @@  COMMON_SFILES = \
 	gdb-dlfcn.c \
 	gdb_obstack.c \
 	gdb_regex.c \
-	gdb_usleep.c \
 	gdbarch.c \
 	gdbarch-selftests.c \
 	gdbtypes.c \
@@ -1265,7 +1264,6 @@  HFILES_NO_SRCDIR = \
 	gdb_regex.h \
 	gdb_select.h \
 	gdb-stabs.h \
-	gdb_usleep.h \
 	gdb_vfork.h \
 	gdb_wchar.h \
 	gdbarch.h \
diff --git a/gdb/gdb_usleep.c b/gdb/gdb_usleep.c
deleted file mode 100644
index 0dcba0e6fad..00000000000
--- a/gdb/gdb_usleep.c
+++ /dev/null
@@ -1,39 +0,0 @@ 
-/* Copyright (C) 2009-2019 Free Software Foundation, Inc.
-
-   This file is part of GDB.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-#include "defs.h"
-#include "gdb_usleep.h"
-#include "common/gdb_select.h"
-#include "common/gdb_sys_time.h"
-
-int
-gdb_usleep (int usec)
-{
-  struct timeval delay;
-  int retval;
-
-  delay.tv_sec = usec / 1000000;
-  delay.tv_usec = usec % 1000000;
-  retval = gdb_select (0, 0, 0, 0, &delay);
-
-  if (retval < 0)
-    retval = -1;
-  else
-    retval = 0;
-
-  return retval;
-}
diff --git a/gdb/gdb_usleep.h b/gdb/gdb_usleep.h
deleted file mode 100644
index aadbf0d0ad6..00000000000
--- a/gdb/gdb_usleep.h
+++ /dev/null
@@ -1,30 +0,0 @@ 
-/* Copyright (C) 2009-2019 Free Software Foundation, Inc.
-
-   This file is part of GDB.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-#if !defined(GDB_USLEEP_H)
-#define GDB_USLEEP_H
-
-/* Suspend execution for USEC microseconds.
-
-   Limitation: If a signal is raised during the delay, gdb_usleep
-   might return earlier than requested.
-
-   It returns 0 on success or -1 on error.  */
-extern int gdb_usleep (int usect);
-
-#endif /* !defined(GDB_USLEEP_H) */
-
diff --git a/gdb/utils.c b/gdb/utils.c
index ec2619642a1..e7fde4942ec 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -62,7 +62,6 @@ 
 
 #include <chrono>
 
-#include "gdb_usleep.h"
 #include "interps.h"
 #include "gdb_regex.h"
 #include "common/job-control.h"