Browse Source

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

user/chris/test/early-mdev
Alejandro Mery 14 years ago
parent
commit
d0b71b3a1c
  1. 65
      base/gpm/legacy_sus.patch

65
base/gpm/legacy_sus.patch

@ -0,0 +1,65 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../gpm/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.
--- ./src/mice.c.orig 2010-09-20 12:32:15.000000000 -0400
+++ ./src/mice.c 2010-09-20 12:30:45.000000000 -0400
@@ -77,6 +77,12 @@
#include "headers/synaptics.h"
#include "headers/message.h"
+#define usleep(usec) x_usleep(usec)
+static inline int x_usleep(useconds_t usec)
+{
+ struct timespec t = { usec/1000000, (usec%1000000)*1000L };
+ return nanosleep(&t, NULL);
+}
/*========================================================================*/
/* Parsing argv: helper dats struct function (should they get elsewhere?) */
--- ./src/synaptics.c.orig 2010-09-20 12:38:35.000000000 -0400
+++ ./src/synaptics.c 2010-09-20 12:40:16.000000000 -0400
@@ -2239,6 +2239,12 @@
****************************************************************************/
+#define usleep(usec) x_usleep(usec)
+static inline int x_usleep(useconds_t usec)
+{
+ struct timespec t = { usec/1000000, (usec%1000000)*1000L };
+ return nanosleep(&t, NULL);
+}
static unsigned char tp_hextoint (unsigned char byte1,
--- ./src/prog/mouse-test.c.orig 2010-09-20 13:34:22.000000000 -0400
+++ ./src/prog/mouse-test.c 2010-09-20 13:35:31.000000000 -0400
@@ -103,6 +103,13 @@
#define GOTOXY(f,x,y) fprintf(f,"\x1B[%03i;%03iH",y,x)
+#define usleep(usec) x_usleep(usec)
+static inline int x_usleep(useconds_t usec)
+{
+ struct timespec t = { usec/1000000, (usec%1000000)*1000L };
+ return nanosleep(&t, NULL);
+}
+
/*-----------------------------------------------------------------------------
Place the description here.
-----------------------------------------------------------------------------*/
Loading…
Cancel
Save