aboutsummaryrefslogtreecommitdiff
path: root/slip.c
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2018-05-20 18:18:40 -0400
committerRob Austein <sra@hactrn.net>2018-05-20 18:18:40 -0400
commite6bdf57820121b6eac9f35c8ef53a4e7a76205e1 (patch)
treeb8701157fa06ea8f873b1c330d9599e4eb7384cf /slip.c
parent76edd86d940956eb42ced93ccd4ee5f1d95bd01f (diff)
Better hal_core_alloc() semantics, assert() and printf() cleanup.
Various fixes extracted from the abandoned(-for-now?) reuse-cores branch, principally: * Change hal_core_alloc*() to support core reuse and to pick the least-recently-used core of a particular type otherwise; * Replace assert() and printf() calls with hal_assert() and hal_log(), respectively. assert() is particularly useless on the HSM, since it sends its error message into hyperspace then hangs the HSM.
Diffstat (limited to 'slip.c')
-rw-r--r--slip.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/slip.c b/slip.c
index b53d54c..c4c74bd 100644
--- a/slip.c
+++ b/slip.c
@@ -48,7 +48,7 @@
#if HAL_SLIP_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