Author: rhs
Date: Thu Oct 25 10:57:27 2012
New Revision: 1402100

URL: http://svn.apache.org/viewvc?rev=1402100&view=rev
Log:
don't ignore the return value of write

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

Modified: qpid/proton/trunk/proton-c/include/proton/driver.h
URL: 
http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/include/proton/driver.h?rev=1402100&r1=1402099&r2=1402100&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/include/proton/driver.h (original)
+++ qpid/proton/trunk/proton-c/include/proton/driver.h Thu Oct 25 10:57:27 2012
@@ -89,8 +89,10 @@ void pn_driver_trace(pn_driver_t *driver
 /** Force pn_driver_wait() to return
  *
  * @param[in] driver the driver to wake up
+ *
+ * @return zero on success, an error code on failure
  */
-void pn_driver_wakeup(pn_driver_t *driver);
+int pn_driver_wakeup(pn_driver_t *driver);
 
 /** Wait for an active connector or listener
  *

Modified: qpid/proton/trunk/proton-c/src/driver.c
URL: 
http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/src/driver.c?rev=1402100&r1=1402099&r2=1402100&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/src/driver.c (original)
+++ qpid/proton/trunk/proton-c/src/driver.c Thu Oct 25 10:57:27 2012
@@ -667,10 +667,17 @@ void pn_driver_free(pn_driver_t *d)
   free(d);
 }
 
-void pn_driver_wakeup(pn_driver_t *d)
+int pn_driver_wakeup(pn_driver_t *d)
 {
   if (d) {
-    write(d->ctrl[1], "x", 1);
+    ssize_t count = write(d->ctrl[1], "x", 1);
+    if (count <= 0) {
+      return count;
+    } else {
+      return 0;
+    }
+  } else {
+    return PN_ARG_ERR;
   }
 }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to