feat(lander): initial lnm integration test
All checks were successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
Jef Roosens 2023-12-02 20:22:05 +01:00
parent 799821d9fc
commit 8ec667af3b
Signed by: Jef Roosens
GPG key ID: B75D4F293C7052DB
15 changed files with 187 additions and 44 deletions

View file

@ -1,6 +1,7 @@
#include <fcntl.h>
#include <netinet/in.h>
#include <poll.h>
#include <stdio.h>
#include <unistd.h>
#include "lnm/common.h"
@ -43,7 +44,9 @@ lnm_err lnm_loop_accept(lnm_loop *l) {
// Append connection to list of connections
if ((size_t)conn_fd >= l->conns.len) {
lnm_loop_conn **new =
realloc(l->conns.arr, sizeof(lnm_loop_conn *) * (conn_fd + 1));
l->conns.len == 0
? calloc(sizeof(lnm_loop_conn *), conn_fd + 1)
: realloc(l->conns.arr, sizeof(lnm_loop_conn *) * (conn_fd + 1));
if (new == NULL) {
close(conn_fd);