]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
Drop duplicated function tool_millisleep() and use dbus_sleep_milliseconds() instead.
authorRalf Habacker <ralf.habacker@freenet.de>
Wed, 4 Mar 2015 10:49:54 +0000 (11:49 +0100)
committerRalf Habacker <ralf.habacker@freenet.de>
Wed, 4 Mar 2015 12:06:49 +0000 (13:06 +0100)
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89284
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
tools/dbus-echo.c
tools/tool-common.c
tools/tool-common.h

index 72973cdb7b9e1731b13401f1b846d40622e1e2f1..10e9dc5b808b817ffd18d34f59f0e43ba692dd46 100644 (file)
@@ -89,7 +89,7 @@ filter (DBusConnection *connection,
 
   if (sleep_ms > 0)
     {
-      tool_millisleep (sleep_ms);
+      _dbus_sleep_milliseconds (sleep_ms);
     }
 
   if (!noreply)
index b1f3650290bb25a0325c0f35439409e913faa635..32020324af705fa68fb1e68be886fa3e6b80f73e 100644 (file)
 #include <unistd.h>
 #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 (&nothing);
-  select (1, &nothing, &nothing, &nothing, &tv);
-#endif
-}
-
 void
 tool_oom (const char *doing)
 {
index 8659011c4e79c56c764facefc27b508d7f0407df..e6397ffb0a8377e7efa804410250d6ecc20fe88a 100644 (file)
@@ -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);