Module Name: src
Committed By: rillig
Date: Tue Oct 12 22:51:28 UTC 2021
Modified Files:
src/usr.sbin/inetd: inetd.c inetd.h parse.c ratelimit.c
Log Message:
inetd: remove trailing whitespace, add space after 'if' and 'for'
No functional change.
To generate a diff of this commit:
cvs rdiff -u -r1.137 -r1.138 src/usr.sbin/inetd/inetd.c
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/inetd/inetd.h
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/inetd/parse.c \
src/usr.sbin/inetd/ratelimit.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/inetd/inetd.c
diff -u src/usr.sbin/inetd/inetd.c:1.137 src/usr.sbin/inetd/inetd.c:1.138
--- src/usr.sbin/inetd/inetd.c:1.137 Tue Oct 12 19:08:04 2021
+++ src/usr.sbin/inetd/inetd.c Tue Oct 12 22:51:28 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: inetd.c,v 1.137 2021/10/12 19:08:04 christos Exp $ */
+/* $NetBSD: inetd.c,v 1.138 2021/10/12 22:51:28 rillig Exp $ */
/*-
* Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
#if 0
static char sccsid[] = "@(#)inetd.c 8.4 (Berkeley) 4/13/94";
#else
-__RCSID("$NetBSD: inetd.c,v 1.137 2021/10/12 19:08:04 christos Exp $");
+__RCSID("$NetBSD: inetd.c,v 1.138 2021/10/12 22:51:28 rillig Exp $");
#endif
#endif /* not lint */
@@ -1399,7 +1399,7 @@ allocchange(void)
bool
try_biltin(struct servtab *sep)
{
- for(size_t i = 0; i < __arraycount(biltins); i++) {
+ for (size_t i = 0; i < __arraycount(biltins); i++) {
if (biltins[i].bi_socktype == sep->se_socktype &&
strcmp(biltins[i].bi_service, sep->se_service) == 0) {
sep->se_bi = &biltins[i];
Index: src/usr.sbin/inetd/inetd.h
diff -u src/usr.sbin/inetd/inetd.h:1.4 src/usr.sbin/inetd/inetd.h:1.5
--- src/usr.sbin/inetd/inetd.h:1.4 Tue Oct 12 19:08:04 2021
+++ src/usr.sbin/inetd/inetd.h Tue Oct 12 22:51:28 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: inetd.h,v 1.4 2021/10/12 19:08:04 christos Exp $ */
+/* $NetBSD: inetd.h,v 1.5 2021/10/12 22:51:28 rillig Exp $ */
/*-
* Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@@ -197,8 +197,8 @@ struct rl_ip_node {
/* align for efficient comparison in rl_try_get, could use 8 instead */
struct in6_addr ipv6_addr __attribute__((aligned(16)));
#endif
- /*
- * other_addr is used for other address types besides the
+ /*
+ * other_addr is used for other address types besides the
* special cases (IPv4/IPv6), using getnameinfo.
*/
struct {
@@ -208,13 +208,13 @@ struct rl_ip_node {
char other_addr[];
};
};
- /*
+ /*
* Do not declare further members after union, offsetof is used to
* determine malloc size.
*/
};
-/*
+/*
* From inetd.c
*/
@@ -262,7 +262,7 @@ extern char *defhost;
extern char *policy;
/*
- * From ratelimit.c
+ * From ratelimit.c
*/
int rl_process(struct servtab *, int);
Index: src/usr.sbin/inetd/parse.c
diff -u src/usr.sbin/inetd/parse.c:1.1 src/usr.sbin/inetd/parse.c:1.2
--- src/usr.sbin/inetd/parse.c:1.1 Tue Oct 12 19:08:04 2021
+++ src/usr.sbin/inetd/parse.c Tue Oct 12 22:51:28 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.1 2021/10/12 19:08:04 christos Exp $ */
+/* $NetBSD: parse.c,v 1.2 2021/10/12 22:51:28 rillig Exp $ */
/*-
* Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
#if 0
static char sccsid[] = "@(#)inetd.c 8.4 (Berkeley) 4/13/94";
#else
-__RCSID("$NetBSD: parse.c,v 1.1 2021/10/12 19:08:04 christos Exp $");
+__RCSID("$NetBSD: parse.c,v 1.2 2021/10/12 22:51:28 rillig Exp $");
#endif
#endif /* not lint */
@@ -453,11 +453,11 @@ more:
goto more;
}
- if(arg[0] == '.') {
+ if (arg[0] == '.') {
if (strcmp(&arg[1], "include") == 0) {
/* include directive */
arg = skip(&cp);
- if(arg == NULL) {
+ if (arg == NULL) {
LOG_TOO_FEW_ARGS();
return NULL;
}
@@ -736,7 +736,7 @@ do { \
/* Parse user:group token */
arg = skip(&cp);
- if(arg == NULL) {
+ if (arg == NULL) {
LOG_TOO_FEW_ARGS();
freeconfig(sep);
goto more;
Index: src/usr.sbin/inetd/ratelimit.c
diff -u src/usr.sbin/inetd/ratelimit.c:1.1 src/usr.sbin/inetd/ratelimit.c:1.2
--- src/usr.sbin/inetd/ratelimit.c:1.1 Tue Oct 12 19:08:04 2021
+++ src/usr.sbin/inetd/ratelimit.c Tue Oct 12 22:51:28 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ratelimit.c,v 1.1 2021/10/12 19:08:04 christos Exp $ */
+/* $NetBSD: ratelimit.c,v 1.2 2021/10/12 22:51:28 rillig Exp $ */
/*-
* Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: ratelimit.c,v 1.1 2021/10/12 19:08:04 christos Exp $");
+__RCSID("$NetBSD: ratelimit.c,v 1.2 2021/10/12 22:51:28 rillig Exp $");
#include <sys/queue.h>
@@ -89,7 +89,7 @@ rl_process(struct servtab *sep, int ctrl
sep->se_time = now;
}
- if(!rl_process_service_max(sep, ctrl, &now)
+ if (!rl_process_service_max(sep, ctrl, &now)
|| !rl_process_ip_max(sep, ctrl, &now)) {
return -1;
}
@@ -225,7 +225,7 @@ static time_t
rl_time(void)
{
struct timespec ts;
- if(clock_gettime(CLOCK_MONOTONIC, &ts) == -1) {
+ if (clock_gettime(CLOCK_MONOTONIC, &ts) == -1) {
syslog(LOG_ERR, "clock_gettime for rate limiting failed: %s; "
"exiting", strerror(errno));
/* Exit inetd if rate limiting fails */
@@ -265,7 +265,7 @@ rl_add(struct servtab *sep, union addr *
node = malloc(node_size);
if (node == NULL) {
- if(errno == ENOMEM) {
+ if (errno == ENOMEM) {
return NULL;
} else {
syslog(LOG_ERR, "malloc failed unexpectedly: %s",
@@ -343,14 +343,14 @@ static bool
rl_process_service_max(struct servtab *sep, int ctrl, time_t *now)
{
if (sep->se_count >= sep->se_service_max) {
- if(*now == -1) {
+ if (*now == -1) {
/* Only get the clock time if we didn't already */
*now = rl_time();
}
if (*now - sep->se_time > CNT_INTVL) {
rl_reset(sep, *now);
- } else {
+ } else {
syslog(LOG_ERR, SERV_FMT
": max spawn rate (%zu in %ji seconds) "
"already met; closing for %ju seconds",
@@ -397,7 +397,7 @@ rl_process_ip_max(struct servtab *sep, i
DPRINTF("Cannot allocate rl_ip_node");
return false;
}
- }
+ }
#ifdef DEBUG_ENABLE
else {
/*
@@ -464,7 +464,7 @@ rl_ip_eq(struct servtab *sep, union addr
break;
#ifdef INET6
case AF_INET6:
- if(rl_ipv6_eq(&addr->ipv6_addr, &cur->ipv6_addr)) {
+ if (rl_ipv6_eq(&addr->ipv6_addr, &cur->ipv6_addr)) {
return true;
}
break;