Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/inetd inetd: remove trailing whitespace, add space ...



details:   https://anonhg.NetBSD.org/src/rev/568ec76e7c0d
branches:  trunk
changeset: 989151:568ec76e7c0d
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Oct 12 22:51:28 2021 +0000

description:
inetd: remove trailing whitespace, add space after 'if' and 'for'

No functional change.

diffstat:

 usr.sbin/inetd/inetd.c     |   6 +++---
 usr.sbin/inetd/inetd.h     |  12 ++++++------
 usr.sbin/inetd/parse.c     |  10 +++++-----
 usr.sbin/inetd/ratelimit.c |  18 +++++++++---------
 4 files changed, 23 insertions(+), 23 deletions(-)

diffs (193 lines):

diff -r 74fd5285f195 -r 568ec76e7c0d usr.sbin/inetd/inetd.c
--- a/usr.sbin/inetd/inetd.c    Tue Oct 12 22:47:18 2021 +0000
+++ b/usr.sbin/inetd/inetd.c    Tue Oct 12 22:51:28 2021 +0000
@@ -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 @@
 #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 @@
 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];
diff -r 74fd5285f195 -r 568ec76e7c0d usr.sbin/inetd/inetd.h
--- a/usr.sbin/inetd/inetd.h    Tue Oct 12 22:47:18 2021 +0000
+++ b/usr.sbin/inetd/inetd.h    Tue Oct 12 22:51:28 2021 +0000
@@ -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 @@
                /* 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 @@
                        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    *policy;
 
 /*
- * From ratelimit.c 
+ * From ratelimit.c
  */
 
 int    rl_process(struct servtab *, int);
diff -r 74fd5285f195 -r 568ec76e7c0d usr.sbin/inetd/parse.c
--- a/usr.sbin/inetd/parse.c    Tue Oct 12 22:47:18 2021 +0000
+++ b/usr.sbin/inetd/parse.c    Tue Oct 12 22:51:28 2021 +0000
@@ -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 @@
                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 @@
 
        /* Parse user:group token */
        arg = skip(&cp);
-       if(arg == NULL) {
+       if (arg == NULL) {
                LOG_TOO_FEW_ARGS();
                freeconfig(sep);
                goto more;
diff -r 74fd5285f195 -r 568ec76e7c0d usr.sbin/inetd/ratelimit.c
--- a/usr.sbin/inetd/ratelimit.c        Tue Oct 12 22:47:18 2021 +0000
+++ b/usr.sbin/inetd/ratelimit.c        Tue Oct 12 22:51:28 2021 +0000
@@ -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 @@
                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 @@
 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 @@
 
        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 @@
 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 @@
                                DPRINTF("Cannot allocate rl_ip_node");
                                return false;
                        }
-               } 
+               }
 #ifdef DEBUG_ENABLE            
                else {
                        /*
@@ -464,7 +464,7 @@
                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;



Home | Main Index | Thread Index | Old Index