[PATCH 1/2] kdbus: Fix the overflow for timeout calculation 96/80596/1 accepted/tizen/ivi/20160719.104426 accepted/tizen/mobile/20160719.104436 accepted/tizen/tv/20160719.104422 accepted/tizen/wearable/20160719.104416 submit/tizen/20160719.063348
authorINSUN PYO <insun.pyo@samsung.com>
Tue, 19 Jul 2016 04:29:08 +0000 (13:29 +0900)
committerINSUN PYO <insun.pyo@samsung.com>
Tue, 19 Jul 2016 04:30:48 +0000 (13:30 +0900)
The maximum value of unsigned long is 4294967295 which is too small
for storing nano second. It makes the overflow in calculation.
Use LLU instead of LU for timeout calculation.
======================================================================

Subject: [PATCH 2/2] kdbus: adjust the default value for timeout to 50 sec
This definition is used by the default value for timeout value.
But in the other places, 50 sec is used by default value for timeout,
instead of using it.
Let's align it with the others

Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: Idddaf3f095ad47206f8b6ac11bc46c43c3bc8bd3

dbus/dbus-transport-kdbus.c

index 63e258d..759c3d7 100644 (file)
@@ -102,7 +102,7 @@ int debug = -1;
              ((uint8_t *)(iter) < (uint8_t *)(first) + (_size)) &&      \
                ((uint8_t *)(iter) >= (uint8_t *)(first));               \
              iter = (void*)(((uint8_t *)iter) + ALIGN8((iter)->size)))
-#define KDBUS_DEFAULT_TIMEOUT_NS   5000000000LU
+#define KDBUS_DEFAULT_TIMEOUT_NS   50000000000LLU
 
 /**
  * @defgroup DBusTransportKdbus DBusTransport implementations for kdbus