aboutsummaryrefslogtreecommitdiff
path: root/rpc_client.c
diff options
context:
space:
mode:
Diffstat (limited to 'rpc_client.c')
-rw-r--r--rpc_client.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/rpc_client.c b/rpc_client.c
index 2fb8ae6..e97289e 100644
--- a/rpc_client.c
+++ b/rpc_client.c
@@ -33,8 +33,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <assert.h>
-
#include "hal.h"
#include "hal_internal.h"
#include "xdr_internal.h"
@@ -46,7 +44,7 @@
#if HAL_RPC_CLIENT_DEBUG
#include <stdio.h>
-#define check(op) do { const hal_error_t _err_ = (op); if (_err_ != HAL_OK) { printf("%s returned %d (%s)\n", #op, _err_, hal_error_string(_err_)); return _err_; } } while (0)
+#define check(op) do { const hal_error_t _err_ = (op); if (_err_ != HAL_OK) { hal_log(HAL_LOG_DEBUG, "%s returned %d (%s)", #op, _err_, hal_error_string(_err_)); return _err_; } } while (0)
#else
#define check(op) do { const hal_error_t _err_ = (op); if (_err_ != HAL_OK) { return _err_; } } while (0)
#endif
@@ -74,14 +72,14 @@ static hal_error_t read_matching_packet(const rpc_func_num_t expected_func,
size_t ilen = inbuf_max;
hal_error_t err;
- assert(inbuf != NULL && iptr != NULL && ilimit != NULL);
+ hal_assert(inbuf != NULL && iptr != NULL && ilimit != NULL);
do {
if ((err = hal_rpc_recv(inbuf, &ilen)) != HAL_OK)
return err;
- assert(ilen <= inbuf_max);
+ hal_assert(ilen <= inbuf_max);
*iptr = inbuf;
*ilimit = inbuf + ilen;