summaryrefslogtreecommitdiff
path: root/libhw/host_net.c
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-11-11 10:22:26 -0700
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-11-11 19:19:48 -0700
commit6ae2bbf849aa597054d7c84d20fc634ed87a1da5 (patch)
treec1deed14207996f685f28a5fb5d553db130d205c /libhw/host_net.c
parentda46fcb709b9df47d788341b3bd87c545f720f4f (diff)
libmisc: Write my own assert.h with assert_notreached()
Diffstat (limited to 'libhw/host_net.c')
-rw-r--r--libhw/host_net.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libhw/host_net.c b/libhw/host_net.c
index 88bda49..db31522 100644
--- a/libhw/host_net.c
+++ b/libhw/host_net.c
@@ -6,7 +6,6 @@
#define _GNU_SOURCE /* for pthread_sigqueue(3gnu) */
/* misc */
-#include <assert.h> /* for assert() */
#include <errno.h> /* for errno, EAGAIN, EINVAL */
#include <error.h> /* for error(3gnu) */
#include <stdlib.h> /* for abs(), shutdown(), SHUT_RD, SHUT_WR, SHUT_RDWR */
@@ -20,6 +19,7 @@
#include <signal.h> /* for siginfo_t, struct sigaction, enum sigval, sigaction(), SA_SIGINFO */
#include <libcr/coroutine.h>
+#include <libmisc/assert.h>
#include <libmisc/vcall.h>
#include <libhw/generic/alarmclock.h>
@@ -325,7 +325,7 @@ static int hostnet_tcp_close(implements_net_stream_conn *_conn, bool rd, bool wr
else if (!rd && wr)
how = SHUT_WR;
else
- assert(false);
+ assert_notreached("invalid arguments to stream_conn.close()");
return hostnet_map_negerrno(shutdown(conn->fd, how) ? -errno : 0);
}