aboutsummaryrefslogtreecommitdiff
path: root/src/net.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/net.c')
-rw-r--r--src/net.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/net.c b/src/net.c
index 95fc021..763f3d7 100644
--- a/src/net.c
+++ b/src/net.c
@@ -2,7 +2,7 @@
2 net.c 2 net.c
3 3
4 This file is part of GNU Anubis. 4 This file is part of GNU Anubis.
5 Copyright (C) 2001-2014 The Anubis Team. 5 Copyright (C) 2001-2024 The Anubis Team.
6 6
7 GNU Anubis is free software; you can redistribute it and/or modify it 7 GNU Anubis is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the 8 under the terms of the GNU General Public License as published by the
@@ -186,7 +186,7 @@ bind_and_listen (char *host, unsigned int port)
186 int sd = 0; 186 int sd = 0;
187 unsigned long inaddr; 187 unsigned long inaddr;
188 struct sockaddr_in addr; 188 struct sockaddr_in addr;
189 int true = 1; 189 int t = 1;
190 190
191 memset (&addr, 0, sizeof (addr)); 191 memset (&addr, 0, sizeof (addr));
192 addr.sin_family = AF_INET; 192 addr.sin_family = AF_INET;
@@ -223,7 +223,7 @@ bind_and_listen (char *host, unsigned int port)
223 else 223 else
224 addr.sin_addr.s_addr = htonl (INADDR_ANY); 224 addr.sin_addr.s_addr = htonl (INADDR_ANY);
225 225
226 setsockopt (sd, SOL_SOCKET, SO_REUSEADDR, &true, sizeof (true)); 226 setsockopt (sd, SOL_SOCKET, SO_REUSEADDR, &t, sizeof (t));
227 227
228 if (bind (sd, (struct sockaddr *) &addr, sizeof (addr))) 228 if (bind (sd, (struct sockaddr *) &addr, sizeof (addr)))
229 anubis_error (EXIT_FAILURE, errno, _("bind() failed")); 229 anubis_error (EXIT_FAILURE, errno, _("bind() failed"));
@@ -341,7 +341,7 @@ void
341net_create_stream (NET_STREAM * str, int fd) 341net_create_stream (NET_STREAM * str, int fd)
342{ 342{
343 stream_create (str); 343 stream_create (str);
344 stream_set_io (*str, (void *) fd, NULL, NULL, NULL, NULL, NULL); 344 stream_set_io (*str, (void *) (ptrdiff_t) fd, NULL, NULL, NULL, NULL, NULL);
345} 345}
346 346
347 347

Return to:

Send suggestions and report system problems to the System administrator.