From 45c36126211967300bd2456ecf59b5daf1b18e61 Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Sat, 25 Sep 2010 08:53:32 -0400 Subject: [PATCH] gdb: changed to use nanosleep() instead of usleep() --- develop/gdb/legacy_sus.patch | 50 ++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 develop/gdb/legacy_sus.patch diff --git a/develop/gdb/legacy_sus.patch b/develop/gdb/legacy_sus.patch new file mode 100644 index 000000000..c4b5975a8 --- /dev/null +++ b/develop/gdb/legacy_sus.patch @@ -0,0 +1,50 @@ +# --- SDE-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# Filename: package/.../gdb/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. + +--- ./gdb/linux-nat.c.orig 2010-09-24 13:21:55.000000000 -0400 ++++ ./gdb/linux-nat.c 2010-09-24 13:28:23.000000000 -0400 +@@ -441,7 +441,8 @@ + is only the single-step breakpoint at vfork's return + point. */ + +- usleep (10000); ++ const struct timespec t = {0, 10000000L}; ++ nanosleep(&t, NULL); + } + + /* Since we vforked, breakpoints were removed in the parent +--- ./gdb/gdbserver/linux-low.c.orig 2010-09-24 13:38:06.000000000 -0400 ++++ ./gdb/gdbserver/linux-low.c 2010-09-24 13:39:40.000000000 -0400 +@@ -384,6 +384,7 @@ + { + int ret; + int to_wait_for = -1; ++ const struct timespec ms = {0, 1000000L}; + + if (*childp != NULL) + to_wait_for = (*childp)->lwpid; +@@ -410,7 +411,7 @@ + else if (ret > 0) + break; + +- usleep (1000); ++ nanosleep(&ms, NULL); + } + + if (debug_threads