[haiku-commits] r35948 - haiku/trunk/src/system/kernel

  • From: ingo_weinhold@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 25 Mar 2010 16:57:38 +0100 (CET)

Author: bonefish
Date: 2010-03-25 16:57:38 +0100 (Thu, 25 Mar 2010)
New Revision: 35948
Changeset: http://dev.haiku-os.org/changeset/35948/haiku

Modified:
   haiku/trunk/src/system/kernel/wait_for_objects.cpp
Log:
_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().


Modified: haiku/trunk/src/system/kernel/wait_for_objects.cpp
===================================================================
--- haiku/trunk/src/system/kernel/wait_for_objects.cpp  2010-03-25 00:14:41 UTC 
(rev 35947)
+++ haiku/trunk/src/system/kernel/wait_for_objects.cpp  2010-03-25 15:57:38 UTC 
(rev 35948)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2007-2009, Ingo Weinhold, ingo_weinhold@xxxxxxx
+ * Copyright 2007-2010, Ingo Weinhold, ingo_weinhold@xxxxxxx
  * Copyright 2002-2008, Axel Dörfler, axeld@xxxxxxxxxxxxxxxxx
  * Distributed under the terms of the MIT License.
  */
@@ -1071,7 +1071,7 @@
                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 @@
 
        return result;
 }
-


Other related posts:

  • » [haiku-commits] r35948 - haiku/trunk/src/system/kernel - ingo_weinhold