diff options
Diffstat (limited to 'src/net.c')
-rw-r--r-- | src/net.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,11 +1,11 @@ /* net.c This file is part of GNU Anubis. - Copyright (C) 2001-2014 The Anubis Team. + Copyright (C) 2001-2024 The Anubis Team. GNU Anubis is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. @@ -183,13 +183,13 @@ connect_directly_to (char *host, unsigned int port) int bind_and_listen (char *host, unsigned int port) { int sd = 0; unsigned long inaddr; struct sockaddr_in addr; - int true = 1; + int t = 1; memset (&addr, 0, sizeof (addr)); addr.sin_family = AF_INET; addr.sin_port = htons (port); if ((sd = socket (AF_INET, SOCK_STREAM, 0)) == -1) @@ -220,13 +220,13 @@ bind_and_listen (char *host, unsigned int port) } } } else addr.sin_addr.s_addr = htonl (INADDR_ANY); - setsockopt (sd, SOL_SOCKET, SO_REUSEADDR, &true, sizeof (true)); + setsockopt (sd, SOL_SOCKET, SO_REUSEADDR, &t, sizeof (t)); if (bind (sd, (struct sockaddr *) &addr, sizeof (addr))) anubis_error (EXIT_FAILURE, errno, _("bind() failed")); info (VERBOSE, _("GNU Anubis bound to %s:%u"), inet_ntoa (addr.sin_addr), ntohs (addr.sin_port)); if (listen (sd, 5)) @@ -338,11 +338,11 @@ net_close_stream (NET_STREAM *sd) void net_create_stream (NET_STREAM * str, int fd) { stream_create (str); - stream_set_io (*str, (void *) fd, NULL, NULL, NULL, NULL, NULL); + stream_set_io (*str, (void *) (ptrdiff_t) fd, NULL, NULL, NULL, NULL, NULL); } /* EOF */ |