Return fail on failing to bind socket

This commit is contained in:
Stephen Seo 2024-08-29 16:45:14 +09:00
parent cc21e5d205
commit b48f1890bf

View file

@ -42,6 +42,9 @@ int main(int argc, char **argv) {
__attribute__((cleanup(cleanup_tcp_socket))) int tcp_socket = __attribute__((cleanup(cleanup_tcp_socket))) int tcp_socket =
create_tcp_socket(args.port); create_tcp_socket(args.port);
if (tcp_socket == -1) {
return 1;
}
struct timespec sleep_time; struct timespec sleep_time;
sleep_time.tv_sec = 0; sleep_time.tv_sec = 0;