mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/virt-viewer
synced 2025-12-27 23:00:54 +00:00
Remove unused usleep code
This commit is contained in:
parent
61a05530b1
commit
67a38decce
@ -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
|
||||
|
||||
@ -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__)
|
||||
|
||||
61
src/usleep.c
61
src/usleep.c
@ -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 <rjones@redhat.com>
|
||||
*/
|
||||
|
||||
/* Replacement usleep function, only used on platforms which lack
|
||||
* this system or library function.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
#include <windows.h>
|
||||
#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
|
||||
Loading…
Reference in New Issue
Block a user