Commit a7695ae5 authored by Samuel Thibault's avatar Samuel Thibault

debian/patches/hurd-i386/git-libpthread-trylock.diff: New patch

(cherry picked from commit 49d62e2b)
parent 3bf221f2
......@@ -228,6 +228,7 @@ glibc (2.26-7) UNRELEASED; urgency=medium
[ Samuel Thibault ]
* debian/patches/hurd-i386/tg-grantpt.diff: Update patch.
* debian/patches/hurd-i386/git-libpthread-trylock.diff: New patch.
-- Aurelien Jarno <aurel32@debian.org> Sat, 17 Feb 2018 23:20:49 +0100
......
commit 55c35d62a3a6ae0d90db40c6e4a2d94d05be71e3
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Sat Feb 24 20:20:33 2018 +0100
Fix pthread_mutex_trylock return value
* sysdeps/mach/hurd/pt-mutex-trylock.c (__pthread_mutex_trylock): Return
EBUSY on failure instead of -1.
diff --git a/libpthread/sysdeps/mach/hurd/pt-mutex-trylock.c b/libpthread/sysdeps/mach/hurd/pt-mutex-trylock.c
index 6680094..59244e8 100644
--- a/libpthread/sysdeps/mach/hurd/pt-mutex-trylock.c
+++ b/libpthread/sysdeps/mach/hurd/pt-mutex-trylock.c
@@ -32,6 +32,8 @@ int __pthread_mutex_trylock (pthread_mutex_t *mtxp)
{
case PT_MTX_NORMAL:
ret = lll_trylock (&mtxp->__lock);
+ if (ret)
+ ret = EBUSY;
break;
case PT_MTX_RECURSIVE:
@@ -49,6 +51,8 @@ int __pthread_mutex_trylock (pthread_mutex_t *mtxp)
mtx_set_owner (mtxp, self, mtxp->__flags);
mtxp->__cnt = 1;
}
+ else
+ ret = EBUSY;
break;
@@ -56,6 +60,8 @@ int __pthread_mutex_trylock (pthread_mutex_t *mtxp)
self = _pthread_self ();
if ((ret = lll_trylock (&mtxp->__lock)) == 0)
mtx_set_owner (mtxp, self, mtxp->__flags);
+ else
+ ret = EBUSY;
break;
case PT_MTX_NORMAL | PTHREAD_MUTEX_ROBUST:
......@@ -115,6 +115,7 @@ hurd-i386/git-libpthread-2.26.diff
hurd-i386/tg-thread-linkspace.diff
hurd-i386/libpthread_includes.diff
hurd-i386/local-exec_filename.diff
hurd-i386/git-libpthread-trylock.diff
hurd-i386/git-test-atexit-race-common.diff
i386/local-biarch.diff
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment