From d7417babd27a96eba9c5e4b740960fb128ac27d1 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Wed, 4 Mar 2015 11:49:54 +0100 Subject: [PATCH] Drop duplicated function tool_millisleep() and use dbus_sleep_milliseconds() instead. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89284 --- tools/dbus-echo.c | 2 +- tools/tool-common.c | 19 ------------------- tools/tool-common.h | 1 - 3 files changed, 1 insertion(+), 21 deletions(-) diff --git a/tools/dbus-echo.c b/tools/dbus-echo.c index 72973cd..10e9dc5 100644 --- a/tools/dbus-echo.c +++ b/tools/dbus-echo.c @@ -89,7 +89,7 @@ filter (DBusConnection *connection, if (sleep_ms > 0) { - tool_millisleep (sleep_ms); + _dbus_sleep_milliseconds (sleep_ms); } if (!noreply) diff --git a/tools/tool-common.c b/tools/tool-common.c index b1f3650..3202032 100644 --- a/tools/tool-common.c +++ b/tools/tool-common.c @@ -37,25 +37,6 @@ #include #endif -/* a hack to avoid having to depend on the static -util version of libdbus; - * it's useful for ancillary programs to be able to use the shared library */ -void -tool_millisleep (unsigned int ms) -{ -#ifdef DBUS_WIN - Sleep (ms); -#else - fd_set nothing; - struct timeval tv; - - tv.tv_sec = ms / 1000; - tv.tv_usec = (ms % 1000) * 1000; - - FD_ZERO (¬hing); - select (1, ¬hing, ¬hing, ¬hing, &tv); -#endif -} - void tool_oom (const char *doing) { diff --git a/tools/tool-common.h b/tools/tool-common.h index 8659011..e6397ff 100644 --- a/tools/tool-common.h +++ b/tools/tool-common.h @@ -32,7 +32,6 @@ #define VERBOSE(...) do {} while (0) #endif -void tool_millisleep (unsigned int ms); void tool_oom (const char *doing) _DBUS_GNUC_NORETURN; dbus_bool_t tool_write_all (int fd, const void *buf, size_t size); -- 1.8.4.5