Browse Source

libvncserver: changed to use nanosleep() instead of usleep()

user/chris/test/early-mdev
Alejandro Mery 14 years ago
parent
commit
0ccc564ccb
  1. 74
      x11/libvncserver/legacy_sus.patch

74
x11/libvncserver/legacy_sus.patch

@ -0,0 +1,74 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../libvncserver/legacy_sus.patch
# Copyright (C) 2010 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or 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.
# --- SDE-COPYRIGHT-NOTE-END ---
usleep() was deprecated by SUSv3 and newer LIBCs are starting to enforce that
deprecation.
--- ./libvncserver/tightvnc-filetransfer/filetransfermsg.c.orig 2010-09-20 13:54:07.000000000 -0400
+++ ./libvncserver/tightvnc-filetransfer/filetransfermsg.c 2010-09-20 14:02:20.000000000 -0400
@@ -28,7 +28,7 @@
#include <stdlib.h>
#include <fcntl.h>
#include <dirent.h>
-#include <utime.h>
+#include <sys/time.h>
#include <errno.h>
#include <unistd.h>
#include <sys/stat.h>
@@ -530,10 +530,11 @@
{
/* Here we are settimg the modification and access time of the file */
/* Windows code stes mod/access/creation time of the file */
- struct utimbuf utb;
+ struct timeval times[2];
- utb.actime = utb.modtime = rtcp->rcft.rcfu.mTime;
- if(utime(rtcp->rcft.rcfu.fName, &utb) == -1) {
+ times[0] = times[1] = (struct timeval) { .tv_sec = rtcp->rcft.rcfu.mTime, .tv_usec = 0 };
+
+ if(utimes(rtcp->rcft.rcfu.fName, times) == -1) {
rfbLog("File [%s]: Method [%s]: Setting the modification/access"
" time for the file <%s> failed\n", __FILE__,
__FUNCTION__, rtcp->rcft.rcfu.fName);
--- ./libvncclient/sockets.c.orig 2010-09-20 14:10:30.000000000 -0400
+++ ./libvncclient/sockets.c 2010-09-20 14:13:55.000000000 -0400
@@ -92,8 +92,10 @@
diff.tv_usec+=1000000;
}
#ifndef __MINGW32__
- sleep (diff.tv_sec);
- usleep (diff.tv_usec);
+ {
+ struct timespec ts = { diff.tv_sec, diff.tv_usec * 1000 };
+ nanosleep(&ts, NULL);
+ }
#else
Sleep (diff.tv_sec * 1000 + diff.tv_usec/1000);
#endif
--- ./libvncserver/main.c.orig 2010-09-20 14:10:23.000000000 -0400
+++ ./libvncserver/main.c 2010-09-20 14:38:30.000000000 -0400
@@ -464,7 +464,10 @@
/* OK, now, to save bandwidth, wait a little while for more
updates to come along. */
- usleep(cl->screen->deferUpdateTime * 1000);
+ {
+ struct timespec ts = {.tv_sec = cl->screen->deferUpdateTime, .tv_nsec = 0};
+ nanosleep(&ts, NULL);
+ }
/* Now, get the region we're going to update, and remove
it from cl->modifiedRegion _before_ we send the update.
Loading…
Cancel
Save