summaryrefslogtreecommitdiff
path: root/ldpd/control.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2022-02-22 19:04:25 -0500
committerDonald Sharp <sharpd@nvidia.com>2022-02-23 19:56:04 -0500
commitcc9f21da2218d95567eff1501482ce58e6600f54 (patch)
treed579c9754161d874bad6eb09c67821b65fb559ca /ldpd/control.c
parenteaba619fc183f68a456b3918f449185b3b477426 (diff)
*: Change thread->func to return void instead of int
The int return value is never used. Modify the code base to just return a void instead. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'ldpd/control.c')
-rw-r--r--ldpd/control.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/ldpd/control.c b/ldpd/control.c
index 3b77765952..376f488bd1 100644
--- a/ldpd/control.c
+++ b/ldpd/control.c
@@ -26,11 +26,11 @@
#define CONTROL_BACKLOG 5
-static int control_accept(struct thread *);
+static void control_accept(struct thread *);
static struct ctl_conn *control_connbyfd(int);
static struct ctl_conn *control_connbypid(pid_t);
static void control_close(int);
-static int control_dispatch_imsg(struct thread *);
+static void control_dispatch_imsg(struct thread *);
struct ctl_conns ctl_conns;
@@ -101,8 +101,7 @@ control_cleanup(char *path)
}
/* ARGSUSED */
-static int
-control_accept(struct thread *thread)
+static void control_accept(struct thread *thread)
{
int connfd;
socklen_t len;
@@ -121,14 +120,14 @@ control_accept(struct thread *thread)
else if (errno != EWOULDBLOCK && errno != EINTR &&
errno != ECONNABORTED)
log_warn("%s: accept", __func__);
- return (0);
+ return;
}
sock_set_nonblock(connfd);
if ((c = calloc(1, sizeof(struct ctl_conn))) == NULL) {
log_warn(__func__);
close(connfd);
- return (0);
+ return;
}
imsg_init(&c->iev.ibuf, connfd);
@@ -140,8 +139,6 @@ control_accept(struct thread *thread)
c->iev.ev_write = NULL;
TAILQ_INSERT_TAIL(&ctl_conns, c, entry);
-
- return (0);
}
static struct ctl_conn *
@@ -191,8 +188,7 @@ control_close(int fd)
}
/* ARGSUSED */
-static int
-control_dispatch_imsg(struct thread *thread)
+static void control_dispatch_imsg(struct thread *thread)
{
int fd = THREAD_FD(thread);
struct ctl_conn *c;
@@ -202,7 +198,7 @@ control_dispatch_imsg(struct thread *thread)
if ((c = control_connbyfd(fd)) == NULL) {
log_warnx("%s: fd %d: not found", __func__, fd);
- return (0);
+ return;
}
c->iev.ev_read = NULL;
@@ -210,13 +206,13 @@ control_dispatch_imsg(struct thread *thread)
if (((n = imsg_read(&c->iev.ibuf)) == -1 && errno != EAGAIN) ||
n == 0) {
control_close(fd);
- return (0);
+ return;
}
for (;;) {
if ((n = imsg_get(&c->iev.ibuf, &imsg)) == -1) {
control_close(fd);
- return (0);
+ return;
}
if (n == 0)
@@ -278,8 +274,6 @@ control_dispatch_imsg(struct thread *thread)
}
imsg_event_add(&c->iev);
-
- return (0);
}
int