diff --git a/configure.ac b/configure.ac index c8a7b06..562726a 100644 --- a/configure.ac +++ b/configure.ac @@ -27,9 +27,6 @@ dnl Decide if this platform can support the SSH tunnel feature. AC_CHECK_HEADERS([sys/socket.h sys/un.h windows.h]) AC_CHECK_FUNCS([fork socketpair]) -dnl Do we need to replace the usleep function (Windows). -AC_REPLACE_FUNCS([usleep]) - dnl --enable-plugin to enable the browser plugin. NSPR_REQUIRED=4.0.0 FIREFOX_PLUGIN_REQUIRED=1.5.0 diff --git a/src/main.c b/src/main.c index 8986151..f12b076 100644 --- a/src/main.c +++ b/src/main.c @@ -51,10 +51,6 @@ #include "viewer.h" -#ifndef HAVE_USLEEP -int usleep (unsigned int usecs); -#endif - // #define DEBUG 1 #ifdef DEBUG #define DEBUG_LOG(s, ...) g_debug((s), ## __VA_ARGS__) diff --git a/src/usleep.c b/src/usleep.c deleted file mode 100644 index 95a09c5..0000000 --- a/src/usleep.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Virt Viewer: A virtual machine console viewer - * - * Copyright (C) 2008 Red Hat. - * - * 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 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Author: Richard W.M. Jones - */ - -/* Replacement usleep function, only used on platforms which lack - * this system or library function. - */ - -#include - -#ifdef HAVE_WINDOWS_H -#include -#endif - -#ifdef WIN32 - -int -usleep (unsigned int usecs) -{ - unsigned int msecs = usecs / 1000; - if (msecs < 1) - Sleep (1); - else - Sleep (msecs); -} - -#else - -int -usleep (unsigned int usecs) -{ - /* This sucks, but everything has sleep and it's not - * really that critical how long we sleep for in the - * main code. - */ - unsigned int secs = usecs / 1000000; - if (secs < 1) - sleep (1); - else - sleep (secs); -} - -#endif