style(9)-ify

This commit is contained in:
Omar Polo 2021-07-07 09:46:37 +00:00
parent 68ef117092
commit a8a1f43921
6 changed files with 38 additions and 19 deletions

6
gmid.c
View File

@ -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);

6
gmid.h
View File

@ -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;

12
iri.c
View File

@ -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)
{

View File

@ -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;
}

View File

@ -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;

3
utf8.c
View File

@ -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