"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
gotwebd sockets.c static
To:
gameoftrees@openbsd.org
Date:
Fri, 19 Aug 2022 23:20:23 +0200

Download raw body.

Thread
These symbols are not used outside of sockets.c, so they should
be marked 'static'. ok?

diff 859aa9f48371a84128b60e2c2ba9f873a4ea70cf 3f9e72a81a5f7f229fc73b3c43411a2df87884e7
commit - 859aa9f48371a84128b60e2c2ba9f873a4ea70cf
commit + 3f9e72a81a5f7f229fc73b3c43411a2df87884e7
blob - 25fab90e6eb901da603fae558a1308fabac74bf1
blob + 0b2059004ba7ccdc453c5f5db08f6bfd1b714825
--- gotwebd/sockets.c
+++ gotwebd/sockets.c
@@ -61,22 +61,22 @@
 
 volatile int client_cnt;
 
-struct timeval	timeout = { TIMEOUT_DEFAULT, 0 };
+static struct timeval	timeout = { TIMEOUT_DEFAULT, 0 };
 
-void	 sockets_sighdlr(int, short, void *);
-void	 sockets_run(struct privsep *, struct privsep_proc *, void *);
-void	 sockets_launch(void);
-void	 sockets_purge(struct gotwebd *);
-void	 sockets_accept_paused(int, short, void *);
-void	 sockets_rlimit(int);
+static void	 sockets_sighdlr(int, short, void *);
+static void	 sockets_run(struct privsep *, struct privsep_proc *, void *);
+static void	 sockets_launch(void);
+static void	 sockets_purge(struct gotwebd *);
+static void	 sockets_accept_paused(int, short, void *);
+static void	 sockets_rlimit(int);
 
+static int	 sockets_dispatch_gotwebd(int, struct privsep_proc *,
+		    struct imsg *);
+static int	 sockets_unix_socket_listen(struct privsep *, struct socket *);
+static int	 sockets_create_socket(struct address *, in_port_t);
+static int	 sockets_accept_reserve(int, struct sockaddr *, socklen_t *,
+		    int, volatile int *);
 
-int	 sockets_dispatch_gotwebd(int, struct privsep_proc *, struct imsg *);
-int	 sockets_unix_socket_listen(struct privsep *, struct socket *);
-int	 sockets_create_socket(struct address *, in_port_t);
-int	 sockets_accept_reserve(int, struct sockaddr *, socklen_t *, int,
-	    volatile int *);
-
 struct socket *sockets_conf_new_socket_unix(struct gotwebd *, struct server *,
     int);
 struct socket *sockets_conf_new_socket_fcgi(struct gotwebd *, struct server *,
@@ -94,7 +94,7 @@ sockets(struct privsep *ps, struct privsep_proc *p)
 	proc_run(ps, p, procs, nitems(procs), sockets_run, NULL);
 }
 
-void
+static void
 sockets_run(struct privsep *ps, struct privsep_proc *p, void *arg)
 {
 	if (config_init(ps->ps_env) == -1)
@@ -240,7 +240,7 @@ sockets_conf_new_socket_fcgi(struct gotwebd *env, stru
 	return (sock);
 }
 
-void
+static void
 sockets_launch(void)
 {
 	struct socket *sock;
@@ -262,7 +262,7 @@ sockets_launch(void)
 	}
 }
 
-void
+static void
 sockets_purge(struct gotwebd *env)
 {
 	struct socket *sock, *tsock;
@@ -281,7 +281,7 @@ sockets_purge(struct gotwebd *env)
 	}
 }
 
-int
+static int
 sockets_dispatch_gotwebd(int fd, struct privsep_proc *p, struct imsg *imsg)
 {
 	struct privsep *ps = p->p_ps;
@@ -325,7 +325,7 @@ sockets_dispatch_gotwebd(int fd, struct privsep_proc *
 	return 0;
 }
 
-void
+static void
 sockets_sighdlr(int sig, short event, void *arg)
 {
 	switch (sig) {
@@ -398,7 +398,7 @@ sockets_privinit(struct gotwebd *env, struct socket *s
 	return 0;
 }
 
-int
+static int
 sockets_unix_socket_listen(struct privsep *ps, struct socket *sock)
 {
 	struct gotwebd *env = ps->ps_env;
@@ -473,7 +473,7 @@ sockets_unix_socket_listen(struct privsep *ps, struct 
 	return u_fd;
 }
 
-int
+static int
 sockets_create_socket(struct address *a, in_port_t port)
 {
 	struct addrinfo hints;
@@ -535,7 +535,7 @@ sockets_create_socket(struct address *a, in_port_t por
 	return (fd);
 }
 
-int
+static int
 sockets_accept_reserve(int sockfd, struct sockaddr *addr, socklen_t *addrlen,
     int reserve, volatile int *counter)
 {
@@ -557,7 +557,7 @@ sockets_accept_reserve(int sockfd, struct sockaddr *ad
 	return ret;
 }
 
-void
+static void
 sockets_accept_paused(int fd, short events, void *arg)
 {
 	struct socket *sock = (struct socket *)arg;
@@ -638,7 +638,7 @@ err:
 		free(c);
 }
 
-void
+static void
 sockets_rlimit(int maxfd)
 {
 	struct rlimit rl;