aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-07-07 09:46:37 +0000
committerOmar Polo <op@omarpolo.com>2021-07-07 09:46:37 +0000
commita8a1f439210de9538b196c6bb5470c306379128c (patch)
tree53c25939117755a85860dab8670cc7faaad56635
parent68ef1170922d8c457b529dd7f64dc207a3c8b5a3 (diff)
style(9)-ify
-rw-r--r--gmid.c6
-rw-r--r--gmid.h6
-rw-r--r--iri.c12
-rw-r--r--sandbox.c18
-rw-r--r--server.c12
-rw-r--r--utf8.c3
6 files changed, 38 insertions, 19 deletions
diff --git a/gmid.c b/gmid.c
index ba1948b..6f349a6 100644
--- a/gmid.c
+++ b/gmid.c
@@ -657,9 +657,11 @@ main(int argc, char **argv)
pidfd = write_pidfile(pidfile);
- /* Linux seems to call the event handlers even when we're
+ /*
+ * Linux seems to call the event handlers even when we're
* doing a sigwait. These dummy handlers are here to avoid
- * being terminated on SIGHUP, SIGINT or SIGTERM. */
+ * being terminated on SIGHUP, SIGINT or SIGTERM.
+ */
signal(SIGHUP, dummy_handler);
signal(SIGINT, dummy_handler);
signal(SIGTERM, dummy_handler);
diff --git a/gmid.h b/gmid.h
index 320cabf..97870df 100644
--- a/gmid.h
+++ b/gmid.h
@@ -123,9 +123,11 @@ struct vhost {
TAILQ_ENTRY(vhost) vhosts;
- /* the first location rule is always '*' and holds the default
+ /*
+ * the first location rule is always '*' and holds the default
* settings for the vhost, then follows the "real" location
- * rules as specified in the configuration. */
+ * rules as specified in the configuration.
+ */
struct lochead locations;
struct envhead env;
diff --git a/iri.c b/iri.c
index 64fcca2..8842eab 100644
--- a/iri.c
+++ b/iri.c
@@ -114,13 +114,15 @@ parse_scheme(struct parser *p)
}
do {
- /* normalize the scheme (i.e. lowercase it)
+ /*
+ * normalize the scheme (i.e. lowercase it)
*
* XXX: since we cannot have good things, tolower
* behaviour depends on the LC_CTYPE locale. The good
* news is that we're sure p->iri points to something
* that's in the ASCII range, so tolower can't
- * mis-behave on some systems due to the locale. */
+ * mis-behave on some systems due to the locale.
+ */
*p->iri = tolower(*p->iri);
p->iri++;
} while (isalnum(*p->iri)
@@ -214,9 +216,11 @@ parse_authority(struct parser *p)
return 0;
}
-/* Routine for path_clean. Elide the pointed .. with the preceding
+/*
+ * Routine for path_clean. Elide the pointed .. with the preceding
* element. Return 0 if it's not possible. incr is the length of
- * the increment, 3 for ../ and 2 for .. */
+ * the increment, 3 for ../ and 2 for ..
+ */
static int
path_elide_dotdot(char *path, char *i, int incr)
{
diff --git a/sandbox.c b/sandbox.c
index 7ac56de..6d57b86 100644
--- a/sandbox.c
+++ b/sandbox.c
@@ -53,8 +53,10 @@ sandbox_server_process(void)
void
sandbox_executor_process(void)
{
- /* We cannot capsicum the executor process because it needs
- * to fork(2)+execve(2) cgi scripts */
+ /*
+ * We cannot capsicum the executor process because it needs to
+ * fork(2)+execve(2) cgi scripts
+ */
return;
}
@@ -435,18 +437,22 @@ sandbox_server_process(void)
void
sandbox_executor_process(void)
{
- /* We cannot use seccomp for the executor process because we
+ /*
+ * We cannot use seccomp for the executor process because we
* don't know what the child will do. Also, our filter will
* be inherited so the child cannot set its own seccomp
- * policy. */
+ * policy.
+ */
return;
}
void
sandbox_logger_process(void)
{
- /* To be honest, here we could use a seccomp policy to only
- * allow writev(2) and memory allocations. */
+ /*
+ * To be honest, here we could use a seccomp policy to only
+ * allow writev(2) and memory allocations.
+ */
return;
}
diff --git a/server.c b/server.c
index 93e5ffd..905ca0f 100644
--- a/server.c
+++ b/server.c
@@ -930,10 +930,12 @@ enter_handle_dirlist(int fd, short ev, void *d)
l = snprintf(c->sbuf, sizeof(c->sbuf),
"# Index of %s\n\n", b);
if (l >= sizeof(c->sbuf)) {
- /* this is impossible, given that we have enough space
+ /*
+ * This is impossible, given that we have enough space
* in c->sbuf to hold the ancilliary string plus the
* full path; but it wouldn't read nice without some
- * error checking, and I'd like to avoid a strlen. */
+ * error checking, and I'd like to avoid a strlen.
+ */
close_conn(fd, ev, c);
return;
}
@@ -1253,8 +1255,10 @@ handle_imsg_quit(struct imsgbuf *ibuf, struct imsg *imsg, size_t len)
(void)imsg;
(void)len;
- /* don't call event_loopbreak since we want to finish to
- * handle the ongoing connections. */
+ /*
+ * don't call event_loopbreak since we want to finish to
+ * handle the ongoing connections.
+ */
shutting_down = 1;
diff --git a/utf8.c b/utf8.c
index 341da33..acba5eb 100644
--- a/utf8.c
+++ b/utf8.c
@@ -1,4 +1,5 @@
-/* Copyright (c) 2008-2009 Bjoern Hoehrmann <bjoern@hoehrmann.de>
+/*
+ * Copyright (c) 2008-2009 Bjoern Hoehrmann <bjoern@hoehrmann.de>
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation