You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kg...@apache.org on 2012/11/14 21:12:26 UTC

svn commit: r1409364 - in /qpid/proton/trunk/proton-c: CMakeLists.txt include/proton/engine.h src/driver.c

Author: kgiusti
Date: Wed Nov 14 20:12:25 2012
New Revision: 1409364

URL: http://svn.apache.org/viewvc?rev=1409364&view=rev
Log:
PROTON-111: review feedback

Modified:
    qpid/proton/trunk/proton-c/CMakeLists.txt
    qpid/proton/trunk/proton-c/include/proton/engine.h
    qpid/proton/trunk/proton-c/src/driver.c

Modified: qpid/proton/trunk/proton-c/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/CMakeLists.txt?rev=1409364&r1=1409363&r2=1409364&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/CMakeLists.txt (original)
+++ qpid/proton/trunk/proton-c/CMakeLists.txt Wed Nov 14 20:12:25 2012
@@ -101,9 +101,10 @@ if (SWIG_FOUND)
   add_subdirectory(bindings)
 endif (SWIG_FOUND)
 
-# Should really be finding the uuid library appropriate for the platform
+# Should really be finding the library appropriate for the platform
 # in lieu of doing this set the library name directly.
 set (UUID_LIB uuid)
+set (TIME_LIB rt)
 
 # Set any additional platform specific C compiler flags
 if (CMAKE_COMPILER_IS_GNUCC)
@@ -162,7 +163,7 @@ add_library (
   ${qpid-proton-platform}
 )
 
-target_link_libraries (qpid-proton ${UUID_LIB} ${SSL_LIB})
+target_link_libraries (qpid-proton ${UUID_LIB} ${SSL_LIB} ${TIME_LIB})
 
 set_target_properties (
   qpid-proton

Modified: qpid/proton/trunk/proton-c/include/proton/engine.h
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/include/proton/engine.h?rev=1409364&r1=1409363&r2=1409364&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/include/proton/engine.h (original)
+++ qpid/proton/trunk/proton-c/include/proton/engine.h Wed Nov 14 20:12:25 2012
@@ -285,8 +285,8 @@ ssize_t pn_transport_output(pn_transport
  * @param[in] transport the transport to process.
  *
  * @return if non-zero, then the expiration time of the next pending timer event for the
- * transport.  The caller must invoke pn_transport_tick again prior to the expiration of
- * this deadline.
+ * transport.  The caller must invoke pn_transport_tick again at least once at or before
+ * this deadline occurs.
  */
 pn_timestamp_t pn_transport_tick(pn_transport_t *transport, pn_timestamp_t now);
 void pn_transport_trace(pn_transport_t *transport, pn_trace_t trace);

Modified: qpid/proton/trunk/proton-c/src/driver.c
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/src/driver.c?rev=1409364&r1=1409363&r2=1409364&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/src/driver.c (original)
+++ qpid/proton/trunk/proton-c/src/driver.c Wed Nov 14 20:12:25 2012
@@ -30,7 +30,6 @@
 #include <netdb.h>
 #include <unistd.h>
 #include <fcntl.h>
-#include <sys/time.h>
 
 #include <proton/driver.h>
 #include <proton/error.h>
@@ -826,8 +825,7 @@ pn_connector_t *pn_driver_connector(pn_d
 
 pn_timestamp_t pn_driver_now(pn_driver_t *driver)
 {
-  struct timeval now;
-  if (gettimeofday(&now, NULL)) pn_fatal("gettimeofday failed\n");
-
-  return ((pn_timestamp_t)now.tv_sec) * 1000 + (now.tv_usec / 1000);
+  struct timespec now;
+  if (clock_gettime(CLOCK_REALTIME, &now)) pn_fatal("clock_gettime() failed\n");
+  return ((pn_timestamp_t)now.tv_sec) * 1000 + (now.tv_nsec / 1000000);
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org