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



details:   https://anonhg.NetBSD.org/src/rev/b55d39f380eb
branches:  trunk
changeset: 1023238:b55d39f380eb
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Aug 30 17:32:23 2021 +0000

description:
inetd: remove trailing whitespace

diffstat:

 usr.sbin/inetd/inetd.c    |  148 ++++++++++++++++++++--------------------
 usr.sbin/inetd/inetd.h    |   14 +-
 usr.sbin/inetd/ipsec.c    |    6 +-
 usr.sbin/inetd/ipsec.h    |    6 +-
 usr.sbin/inetd/parse_v2.c |  166 +++++++++++++++++++++++-----------------------
 5 files changed, 170 insertions(+), 170 deletions(-)

diffs (truncated from 1170 to 300 lines):

diff -r 21f8437cc61e -r b55d39f380eb usr.sbin/inetd/inetd.c
--- a/usr.sbin/inetd/inetd.c    Mon Aug 30 17:08:13 2021 +0000
+++ b/usr.sbin/inetd/inetd.c    Mon Aug 30 17:32:23 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: inetd.c,v 1.129 2021/08/30 08:21:12 mlelstv Exp $      */
+/*     $NetBSD: inetd.c,v 1.130 2021/08/30 17:32:23 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.129 2021/08/30 08:21:12 mlelstv Exp $");
+__RCSID("$NetBSD: inetd.c,v 1.130 2021/08/30 17:32:23 rillig Exp $");
 #endif
 #endif /* not lint */
 
@@ -484,7 +484,7 @@
                        if (!sep->se_wait && sep->se_socktype == SOCK_STREAM) {
                                /* XXX here do the libwrap check-before-accept*/
                                ctrl = accept(sep->se_fd, NULL, NULL);
-                               DPRINTF(SERV_FMT ": accept, ctrl fd %d", 
+                               DPRINTF(SERV_FMT ": accept, ctrl fd %d",
                                    SERV_PARAMS(sep), ctrl);
                                if (ctrl < 0) {
                                        if (errno != EINTR)
@@ -644,7 +644,7 @@
                } else if (sep->se_group) {
                        (void) setgid((gid_t)grp->gr_gid);
                }
-               DPRINTF("%d execl %s", 
+               DPRINTF("%d execl %s",
                    getpid(), sep->se_server);
                /* Set our control descriptor to not close-on-exec... */
                if (fcntl(ctrl, F_SETFD, 0) < 0)
@@ -705,21 +705,21 @@
 
 size_t line_number;
 
-/* 
+/*
  * Recursively merge loaded service definitions with any defined
- * in the current or included config files. 
+ * in the current or included config files.
  */
 static void
 config(void)
 {
        struct servtab *sep, *cp;
        /*
-        * Current position in line, used with key-values notation, 
-        * saves cp across getconfigent calls. 
+        * Current position in line, used with key-values notation,
+        * saves cp across getconfigent calls.
         */
        char *current_pos;
        size_t n;
-       
+
        /* open config file from beginning */
        fconfig = fopen(CONFIG, "r");
        if(fconfig == NULL) {
@@ -729,7 +729,7 @@
 
        /* First call to nextline will advance line_number to 1 */
        line_number = 0;
-       
+
        /* Start parsing at the beginning of the first line */
        current_pos = nextline(fconfig);
 
@@ -782,9 +782,9 @@
                }
                sep->se_checked = 1;
 
-               /* 
+               /*
                 * Remainder of config(void) checks validity of servtab options
-                * and sets up the service by setting up sockets (in setup(servtab)). 
+                * and sets up the service by setting up sockets (in setup(servtab)).
                 */
                switch (sep->se_family) {
                case AF_LOCAL:
@@ -842,7 +842,7 @@
                        if (isrpcservice(sep) || ISMUX(sep))
                                port = "0";
                        else
-                               port = sep->se_service;         
+                               port = sep->se_service;
                        error = getaddrinfo(host, port, &hints, &res);
                        if (error) {
                                if (error == EAI_SERVICE) {
@@ -886,7 +886,7 @@
                                        rp = getrpcbyname(sep->se_service);
                                        if (rp == 0) {
                                                syslog(LOG_ERR,
-                                                   SERV_FMT 
+                                                   SERV_FMT
                                                    ": unknown service",
                                                    SERV_PARAMS(sep));
                                                sep->se_checked = 0;
@@ -943,7 +943,7 @@
        for (sep = servtab; sep != NULL; sep = sep->se_next) {
                if (sep->se_fd == -1)
                        continue;
-               
+
                switch (sep->se_family) {
                case AF_LOCAL:
                        (void)unlink(sep->se_service);
@@ -972,7 +972,7 @@
        struct kevent   *ev;
 
        if ((sep->se_fd = socket(sep->se_family, sep->se_socktype, 0)) < 0) {
-               DPRINTF("socket failed on " SERV_FMT ": %s", 
+               DPRINTF("socket failed on " SERV_FMT ": %s",
                    SERV_PARAMS(sep), strerror(errno));
                syslog(LOG_ERR, "%s/%s: socket: %m",
                    sep->se_service, sep->se_proto);
@@ -1067,7 +1067,7 @@
  */
 static void
 close_sep(struct servtab *sep)
-{      
+{
 
        if (sep->se_fd >= 0) {
                (void) close(sep->se_fd);
@@ -1201,25 +1201,25 @@
 getconfigent(char **current_pos)
 {
        struct servtab *sep = &serv;
-       int argc, val; 
+       int argc, val;
        char *cp, *cp0, *arg, *buf0, *buf1, *sz0, *sz1;
        static char TCPMUX_TOKEN[] = "tcpmux/";
 #define MUX_LEN                (sizeof(TCPMUX_TOKEN)-1)
        char *hostdelim;
 
-       /* 
-        * Pre-condition: current_pos points into line, 
+       /*
+        * Pre-condition: current_pos points into line,
         * line contains config line. Continue where the last getconfigent left off.
-        * Allows for multiple service definitions per line. 
+        * Allows for multiple service definitions per line.
         */
        cp = *current_pos;
 
        if (false) {
-               /* 
-                * Go to the next line, but only after attemting to read the current 
-                * one! Keep reading until we find a valid definition or EOF. 
+               /*
+                * Go to the next line, but only after attemting to read the current
+                * one! Keep reading until we find a valid definition or EOF.
                 */
-more:  
+more:
                cp = nextline(fconfig);
        }
 
@@ -1244,8 +1244,8 @@
                                if (ipsecsetup_test(p) < 0) {
                                        ERR("Invalid IPsec policy \"%s\"", p);
                                        LOG_EARLY_ENDCONF();
-                                       /* 
-                                       * Stop reading the current config to prevent services 
+                                       /*
+                                       * Stop reading the current config to prevent services
                                        * from being run without IPsec.
                                        */
                                        return NULL;
@@ -1283,7 +1283,7 @@
                        goto more;
                }
        }
-       
+
        /* After this point, we might need to store data in a servtab */
        *sep = init_servtab();
 
@@ -1353,16 +1353,16 @@
                        freeconfig(sep);
                        goto more;
                case V2_ERROR:
-                       /* 
+                       /*
                         * Unrecoverable error, stop reading. freeconfig is called
-                        * in parse_v2.c 
+                        * in parse_v2.c
                         */
                        LOG_EARLY_ENDCONF();
                        freeconfig(sep);
                        return NULL;
                }
        } else if (strcmp(arg, "off") == 0 || strncmp(arg, "off#", 4) == 0) {
-               
+
                if (arg[3] == '#') {
                        cp = nextline(fconfig);
                }
@@ -1523,7 +1523,7 @@
                if (cp1 != NULL) {
                        int rstatus;
                        *cp1++ = '\0';
-                       sep->se_service_max = (size_t)strtou(cp1, NULL, 10, 0, 
+                       sep->se_service_max = (size_t)strtou(cp1, NULL, 10, 0,
                            SERVTAB_COUNT_MAX, &rstatus);
 
                        if (rstatus != 0) {
@@ -1533,7 +1533,7 @@
                                }
 
                                WRN("Improper \"max\" value '%s', "
-                                   "using '%zu' instead: %s", 
+                                   "using '%zu' instead: %s",
                                    cp1,
                                    sep->se_service_max,
                                    strerror(rstatus));
@@ -1581,7 +1581,7 @@
                freeconfig(sep);
                goto more;
        }
-       
+
        argc = 0;
        for (arg = skip(&cp); cp; arg = skip(&cp)) {
                if (argc < MAXARGV)
@@ -1647,7 +1647,7 @@
 
                c = getc(fconfig);
                (void) ungetc(c, fconfig);
-               if (c == ' ' || c == '\t') 
+               if (c == ' ' || c == '\t')
                        if ((cp = nextline(fconfig)) != NULL)
                                goto again;
                *cpp = NULL;
@@ -1805,7 +1805,7 @@
 /* ARGSUSED */
 static void
 discard_dg(int s, struct servtab *sep) /* Discard service -- ignore data */
-       
+
 {
        char buffer[BUFSIZE];
 
@@ -2256,8 +2256,8 @@
        purge_unchecked();
 }
 
-static void 
-purge_unchecked(void) 
+static void
+purge_unchecked(void)
 {
        struct servtab *sep, **sepp = &servtab;
        int servtab_count = 0;
@@ -2285,9 +2285,9 @@
 }
 
 static bool
-is_same_service(const struct servtab *sep, const struct servtab *cp) 
+is_same_service(const struct servtab *sep, const struct servtab *cp)
 {
-       return 
+       return
            strcmp(sep->se_service, cp->se_service) == 0 &&
            strcmp(sep->se_hostaddr, cp->se_hostaddr) == 0 &&
            strcmp(sep->se_proto, cp->se_proto) == 0 &&
@@ -2295,9 +2295,9 @@
            ISMUX(sep) == ISMUX(cp);
 }
 
-int 
+int
 parse_protocol(struct servtab *sep)
-{      
+{
        int val;
 
        if (strcmp(sep->se_proto, "unix") == 0) {
@@ -2409,11 +2409,11 @@
 }
 
 /* TODO test to make sure accept filter still works */
-void 
+void
 parse_accept_filter(char *arg, struct servtab *sep) {
        char *accf, *accf_arg;
        /* one and only one accept filter */
-       accf = strchr(arg, ':');        
+       accf = strchr(arg, ':');
        if (!accf)
                return;
        if (accf != strrchr(arg, ':') || *(accf + 1) == '\0') {
@@ -2437,7 +2437,7 @@
        }
 }



Home | Main Index | Thread Index | Old Index