}
return (psmb_result_t){PSMB_OK};
}
+
+void psmb_destroy(psmb_ctx_t *ctx)
+{
+ if (ctx->fd == -1) {
+ LOG(ctx, LOG_ERR, "psmb_ctx is not open");
+ } else {
+ if (close(ctx->fd) == -1)
+ LOG(ctx, LOG_ERR, "close(): %m");
+ }
+ /* clean up the rest */
+ (*ctx->free)(ctx);
+}