From a959bc5b23c2d9800295f302d9714c3918dc89d3 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Thu, 25 Mar 2010 15:57:38 +0000 Subject: [PATCH] _user_wait_for_objects(): Don't copy the infos back to userland when an error occurred. This fixes the automatic syscall restart case (would wait forever) and aligns the behavior with poll(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35948 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/wait_for_objects.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/system/kernel/wait_for_objects.cpp b/src/system/kernel/wait_for_objects.cpp index 349c2c9c86..4ed3c90a2e 100644 --- a/src/system/kernel/wait_for_objects.cpp +++ b/src/system/kernel/wait_for_objects.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2007-2009, Ingo Weinhold, ingo_weinhold@gmx.de. + * Copyright 2007-2010, Ingo Weinhold, ingo_weinhold@gmx.de. * Copyright 2002-2008, Axel Dörfler, axeld@pinc-software.de. * Distributed under the terms of the MIT License. */ @@ -1071,7 +1071,7 @@ _user_wait_for_objects(object_wait_info* userInfos, int numInfos, uint32 flags, result = common_wait_for_objects(infos, numInfos, flags, timeout, false); - if (user_memcpy(userInfos, infos, bytes) != B_OK) { + if (result >= 0 && user_memcpy(userInfos, infos, bytes) != B_OK) { if (result >= 0) result = B_BAD_ADDRESS; } else @@ -1083,4 +1083,3 @@ _user_wait_for_objects(object_wait_info* userInfos, int numInfos, uint32 flags, return result; } -