I think this is more user friendly.
Signed-off-by: Angus Salkeld asalkeld@redhat.com --- lib/ipcc.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/lib/ipcc.c b/lib/ipcc.c index ec59b25..8ce9ca2 100644 --- a/lib/ipcc.c +++ b/lib/ipcc.c @@ -40,12 +40,8 @@ qb_ipcc_connect(const char *name, size_t max_msg_size) return NULL; }
- if (max_msg_size < sizeof(struct qb_ipc_connection_response)) { - errno = EINVAL; - return NULL; - } - - c->setup.max_msg_size = max_msg_size; + c->setup.max_msg_size = QB_MAX(max_msg_size, + sizeof(struct qb_ipc_connection_response)); (void)strlcpy(c->name, name, NAME_MAX); res = qb_ipcc_us_setup_connect(c, &response); if (res < 0) {