[haiku-commits] AW: [haiku-commits] haiku: hrev45609 - headers/private/net

  • From: "superstippi@xxxxxx" <superstippi@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 03 May 2013 21:49:15 +0200

Hi,

Sorry for top-posting. Why wouldn't any timeout be relative?

Best regards,
Stephan

----- Reply message -----
Von: axeld@xxxxxxxxxxxxxxxx
An: <haiku-commits@xxxxxxxxxxxxx>
Betreff: [haiku-commits] haiku: hrev45609 - headers/private/net
Datum: Fr., Mai 3, 2013 21:06


hrev45609 adds 1 changeset to branch 'master'
old head: e5d65858f2361fe0552495b61620c84dcee6bc00
new head: 4e78098e7c4508d8e72d02807a12f88ba74c3c85
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=4e78098+%5Ee5d6585

----------------------------------------------------------------------------

4e78098: DatagramSocket: don't use absolute timeout 0.
  
  * Use relative instead, or else the return value will be B_TIMED_OUT instead
    of B_WOULD_BLOCK.
  * This fixes bug #9734.

                                   [ Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev45609
Commit:      4e78098e7c4508d8e72d02807a12f88ba74c3c85
URL:         http://cgit.haiku-os.org/haiku/commit/?id=4e78098
Author:      Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
Date:        Fri May  3 19:03:54 2013 UTC

Ticket:      https://dev.haiku-os.org/ticket/9734

----------------------------------------------------------------------------

1 file changed, 4 insertions(+), 3 deletions(-)
headers/private/net/ProtocolUtilities.h | 7 ++++---

----------------------------------------------------------------------------

diff --git a/headers/private/net/ProtocolUtilities.h 
b/headers/private/net/ProtocolUtilities.h
index fd4280f..e296ce3 100644
--- a/headers/private/net/ProtocolUtilities.h
+++ b/headers/private/net/ProtocolUtilities.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2007-2010, Haiku, Inc. All Rights Reserved.
+ * Copyright 2007-2013, Haiku, Inc. All Rights Reserved.
  * Distributed under the terms of the MIT License.
  *
  * Authors:
@@ -37,6 +37,7 @@ public:
 extern net_buffer_module_info* gBufferModule;
 extern net_stack_module_info* gStackModule;
 
+
 class NetModuleBundleGetter {
 public:
        static net_stack_module_info* Stack() { return gStackModule; }
@@ -294,7 +295,7 @@ DECL_DATAGRAM_SOCKET(inline status_t)::SocketStatus(bool 
peek) const
 {
        if (peek)
                return fSocket->error;
-       
+
        status_t status = fSocket->error;
        fSocket->error = B_OK;
 
@@ -345,7 +346,7 @@ DECL_DATAGRAM_SOCKET(inline status_t)::_Wait(bigtime_t 
timeout)
 {
        LockingBase::Unlock(&fLock);
        status_t status = acquire_sem_etc(fNotify, 1, B_CAN_INTERRUPT
-               | B_ABSOLUTE_TIMEOUT, timeout);
+               | (timeout != 0 ? B_ABSOLUTE_TIMEOUT : B_RELATIVE_TIMEOUT), 
timeout);
        LockingBase::Lock(&fLock);
 
        return status;


Other related posts:

  • » [haiku-commits] AW: [haiku-commits] haiku: hrev45609 - headers/private/net - superstippi@xxxxxx