From 0552c3f9acdfb38181f72d97f12dc4ed2b17d064 Mon Sep 17 00:00:00 2001 From: glebius Date: Wed, 28 Jun 2006 10:38:38 +0000 Subject: Style: space after "return". --- usr.sbin/ngctl/config.c | 6 +++--- usr.sbin/ngctl/connect.c | 6 +++--- usr.sbin/ngctl/debug.c | 6 +++--- usr.sbin/ngctl/list.c | 8 ++++---- usr.sbin/ngctl/main.c | 34 +++++++++++++++++----------------- usr.sbin/ngctl/mkpeer.c | 6 +++--- usr.sbin/ngctl/msg.c | 8 ++++---- usr.sbin/ngctl/name.c | 6 +++--- usr.sbin/ngctl/rmhook.c | 6 +++--- usr.sbin/ngctl/show.c | 10 +++++----- usr.sbin/ngctl/shutdown.c | 6 +++--- usr.sbin/ngctl/status.c | 6 +++--- usr.sbin/ngctl/types.c | 6 +++--- usr.sbin/ngctl/write.c | 16 ++++++++-------- 14 files changed, 65 insertions(+), 65 deletions(-) (limited to 'usr.sbin/ngctl') diff --git a/usr.sbin/ngctl/config.c b/usr.sbin/ngctl/config.c index edd47d1..739a693 100644 --- a/usr.sbin/ngctl/config.c +++ b/usr.sbin/ngctl/config.c @@ -69,7 +69,7 @@ ConfigCmd(int ac, char **av) /* Get arguments */ if (ac < 2) - return(CMDRTN_USAGE); + return (CMDRTN_USAGE); path = av[1]; *buf = '\0'; @@ -93,7 +93,7 @@ ConfigCmd(int ac, char **av) break; default: warn("send msg"); - return(CMDRTN_ERROR); + return (CMDRTN_ERROR); } } else { if (NgRecvMsg(csock, resp, sizeof(sbuf), NULL) < 0 @@ -106,6 +106,6 @@ ConfigCmd(int ac, char **av) printf("No config available for \"%s\"\n", path); else printf("Config for \"%s\":\n%s\n", path, status); - return(CMDRTN_OK); + return (CMDRTN_OK); } diff --git a/usr.sbin/ngctl/connect.c b/usr.sbin/ngctl/connect.c index a9e16f1..cd5307e 100644 --- a/usr.sbin/ngctl/connect.c +++ b/usr.sbin/ngctl/connect.c @@ -76,15 +76,15 @@ ConnectCmd(int ac, char **av) snprintf(con.peerhook, sizeof(con.peerhook), "%s", av[3]); break; default: - return(CMDRTN_USAGE); + return (CMDRTN_USAGE); } /* Send message */ if (NgSendMsg(csock, path, NGM_GENERIC_COOKIE, NGM_CONNECT, &con, sizeof(con)) < 0) { warn("send msg"); - return(CMDRTN_ERROR); + return (CMDRTN_ERROR); } - return(CMDRTN_OK); + return (CMDRTN_OK); } diff --git a/usr.sbin/ngctl/debug.c b/usr.sbin/ngctl/debug.c index 4fa074d..491bfb4 100644 --- a/usr.sbin/ngctl/debug.c +++ b/usr.sbin/ngctl/debug.c @@ -70,15 +70,15 @@ DebugCmd(int ac, char **av) else if (!strcmp(av[1], "-")) level = NgSetDebug(-1) - 1; else if ((level = atoi(av[1])) < 0) - return(CMDRTN_USAGE); + return (CMDRTN_USAGE); NgSetDebug(level); break; case 1: printf("Current debug level is %d\n", NgSetDebug(-1)); break; default: - return(CMDRTN_USAGE); + return (CMDRTN_USAGE); } - return(CMDRTN_OK); + return (CMDRTN_OK); } diff --git a/usr.sbin/ngctl/list.c b/usr.sbin/ngctl/list.c index 7f12434..966a8a5 100644 --- a/usr.sbin/ngctl/list.c +++ b/usr.sbin/ngctl/list.c @@ -83,7 +83,7 @@ ListCmd(int ac, char **av) break; case '?': default: - return(CMDRTN_USAGE); + return (CMDRTN_USAGE); break; } } @@ -95,18 +95,18 @@ ListCmd(int ac, char **av) case 0: break; default: - return(CMDRTN_USAGE); + return (CMDRTN_USAGE); } /* Get list of nodes */ if (NgSendMsg(csock, ".", NGM_GENERIC_COOKIE, named_only ? NGM_LISTNAMES : NGM_LISTNODES, NULL, 0) < 0) { warn("send msg"); - return(CMDRTN_ERROR); + return (CMDRTN_ERROR); } if (NgAllocRecvMsg(csock, &resp, NULL) < 0) { warn("recv msg"); - return(CMDRTN_ERROR); + return (CMDRTN_ERROR); } /* Show each node */ diff --git a/usr.sbin/ngctl/main.c b/usr.sbin/ngctl/main.c index ecf4cab..a09a0cf1 100644 --- a/usr.sbin/ngctl/main.c +++ b/usr.sbin/ngctl/main.c @@ -188,7 +188,7 @@ main(int ac, char *av[]) rtn = EX_OSERR; break; } - return(rtn); + return (rtn); } /* @@ -205,10 +205,10 @@ ReadFile(FILE *fp) continue; if ((rtn = DoParseCommand(line)) != 0) { warnx("line %d: error in file", num); - return(rtn); + return (rtn); } } - return(CMDRTN_OK); + return (CMDRTN_OK); } /* @@ -280,7 +280,7 @@ DoInteractive(void) break; } } - return(CMDRTN_QUIT); + return (CMDRTN_QUIT); } /* @@ -298,7 +298,7 @@ DoParseCommand(char *line) av[++ac] = strtok(NULL, WHITESPACE)); /* Do command */ - return(DoCommand(ac, av)); + return (DoCommand(ac, av)); } /* @@ -311,12 +311,12 @@ DoCommand(int ac, char **av) int rtn; if (ac == 0 || *av[0] == 0) - return(CMDRTN_OK); + return (CMDRTN_OK); if ((cmd = FindCommand(av[0])) == NULL) - return(CMDRTN_ERROR); + return (CMDRTN_ERROR); if ((rtn = (*cmd->func)(ac, av)) == CMDRTN_USAGE) warnx("usage: %s", cmd->cmd); - return(rtn); + return (rtn); } /* @@ -331,16 +331,16 @@ FindCommand(const char *string) if (MatchCommand(cmds[k], string)) { if (found != -1) { warnx("\"%s\": ambiguous command", string); - return(NULL); + return (NULL); } found = k; } } if (found == -1) { warnx("\"%s\": unknown command", string); - return(NULL); + return (NULL); } - return(cmds[found]); + return (cmds[found]); } /* @@ -383,17 +383,17 @@ ReadCmd(int ac, char **av) case 2: if ((fp = fopen(av[1], "r")) == NULL) { warn("%s", av[1]); - return(CMDRTN_ERROR); + return (CMDRTN_ERROR); } break; default: - return(CMDRTN_USAGE); + return (CMDRTN_USAGE); } /* Process it */ rtn = ReadFile(fp); fclose(fp); - return(rtn); + return (rtn); } /* @@ -419,7 +419,7 @@ HelpCmd(int ac, char **av) *s = '\0'; printf(" %-10s %s\n", buf, cmd->desc); } - return(CMDRTN_OK); + return (CMDRTN_OK); default: /* Show help on a specific command */ if ((cmd = FindCommand(av[1])) != NULL) { @@ -462,7 +462,7 @@ HelpCmd(int ac, char **av) } } } - return(CMDRTN_OK); + return (CMDRTN_OK); } /* @@ -471,7 +471,7 @@ HelpCmd(int ac, char **av) static int QuitCmd(int ac __unused, char **av __unused) { - return(CMDRTN_QUIT); + return (CMDRTN_QUIT); } /* diff --git a/usr.sbin/ngctl/mkpeer.c b/usr.sbin/ngctl/mkpeer.c index 083a627..77c43a3 100644 --- a/usr.sbin/ngctl/mkpeer.c +++ b/usr.sbin/ngctl/mkpeer.c @@ -76,15 +76,15 @@ MkPeerCmd(int ac, char **av) snprintf(mkp.peerhook, sizeof(mkp.peerhook), "%s", av[3]); break; default: - return(CMDRTN_USAGE); + return (CMDRTN_USAGE); } /* Send message */ if (NgSendMsg(csock, path, NGM_GENERIC_COOKIE, NGM_MKPEER, &mkp, sizeof(mkp)) < 0) { warn("send msg"); - return(CMDRTN_ERROR); + return (CMDRTN_ERROR); } - return(CMDRTN_OK); + return (CMDRTN_OK); } diff --git a/usr.sbin/ngctl/msg.c b/usr.sbin/ngctl/msg.c index fa5ae29..c332879 100644 --- a/usr.sbin/ngctl/msg.c +++ b/usr.sbin/ngctl/msg.c @@ -70,7 +70,7 @@ MsgCmd(int ac, char **av) /* Get arguments */ if (ac < 3) - return(CMDRTN_USAGE); + return (CMDRTN_USAGE); path = av[1]; cmdstr = av[2]; @@ -79,7 +79,7 @@ MsgCmd(int ac, char **av) len += strlen(av[i]) + 1; if ((buf = malloc(len)) == NULL) { warn("malloc"); - return(CMDRTN_ERROR); + return (CMDRTN_ERROR); } for (*buf = '\0', i = 3; i < ac; i++) { snprintf(buf + strlen(buf), @@ -90,7 +90,7 @@ MsgCmd(int ac, char **av) if (NgSendAsciiMsg(csock, path, "%s%s", cmdstr, buf) < 0) { free(buf); warn("send msg"); - return(CMDRTN_ERROR); + return (CMDRTN_ERROR); } free(buf); @@ -114,7 +114,7 @@ MsgCmd(int ac, char **av) } /* Done */ - return(CMDRTN_OK); + return (CMDRTN_OK); } /* diff --git a/usr.sbin/ngctl/name.c b/usr.sbin/ngctl/name.c index 92736a7..a557134 100644 --- a/usr.sbin/ngctl/name.c +++ b/usr.sbin/ngctl/name.c @@ -67,15 +67,15 @@ NameCmd(int ac, char **av) snprintf(name.name, sizeof(name.name), "%s", av[2]); break; default: - return(CMDRTN_USAGE); + return (CMDRTN_USAGE); } /* Send message */ if (NgSendMsg(csock, path, NGM_GENERIC_COOKIE, NGM_NAME, &name, sizeof(name)) < 0) { warn("send msg"); - return(CMDRTN_ERROR); + return (CMDRTN_ERROR); } - return(CMDRTN_OK); + return (CMDRTN_OK); } diff --git a/usr.sbin/ngctl/rmhook.c b/usr.sbin/ngctl/rmhook.c index ba63a9e..9a47a9d 100644 --- a/usr.sbin/ngctl/rmhook.c +++ b/usr.sbin/ngctl/rmhook.c @@ -72,15 +72,15 @@ RmHookCmd(int ac, char **av) snprintf(rmh.ourhook, sizeof(rmh.ourhook), "%s", av[1]); break; default: - return(CMDRTN_USAGE); + return (CMDRTN_USAGE); } /* Send message */ if (NgSendMsg(csock, path, NGM_GENERIC_COOKIE, NGM_RMHOOK, &rmh, sizeof(rmh)) < 0) { warn("send msg"); - return(CMDRTN_ERROR); + return (CMDRTN_ERROR); } - return(CMDRTN_OK); + return (CMDRTN_OK); } diff --git a/usr.sbin/ngctl/show.c b/usr.sbin/ngctl/show.c index e60830a..5232645 100644 --- a/usr.sbin/ngctl/show.c +++ b/usr.sbin/ngctl/show.c @@ -77,7 +77,7 @@ ShowCmd(int ac, char **av) break; case '?': default: - return(CMDRTN_USAGE); + return (CMDRTN_USAGE); break; } } @@ -90,18 +90,18 @@ ShowCmd(int ac, char **av) path = av[0]; break; default: - return(CMDRTN_USAGE); + return (CMDRTN_USAGE); } /* Get node info and hook list */ if (NgSendMsg(csock, path, NGM_GENERIC_COOKIE, NGM_LISTHOOKS, NULL, 0) < 0) { warn("send msg"); - return(CMDRTN_ERROR); + return (CMDRTN_ERROR); } if (NgAllocRecvMsg(csock, &resp, NULL) < 0) { warn("recv msg"); - return(CMDRTN_ERROR); + return (CMDRTN_ERROR); } /* Show node information */ @@ -133,7 +133,7 @@ ShowCmd(int ac, char **av) } } free(resp); - return(CMDRTN_OK); + return (CMDRTN_OK); } diff --git a/usr.sbin/ngctl/shutdown.c b/usr.sbin/ngctl/shutdown.c index e5679dd..b06beb5 100644 --- a/usr.sbin/ngctl/shutdown.c +++ b/usr.sbin/ngctl/shutdown.c @@ -64,16 +64,16 @@ ShutdownCmd(int ac, char **av) path = av[1]; break; default: - return(CMDRTN_USAGE); + return (CMDRTN_USAGE); } /* Shutdown node */ if (NgSendMsg(csock, path, NGM_GENERIC_COOKIE, NGM_SHUTDOWN, NULL, 0) < 0) { warn("shutdown"); - return(CMDRTN_ERROR); + return (CMDRTN_ERROR); } - return(CMDRTN_OK); + return (CMDRTN_OK); } diff --git a/usr.sbin/ngctl/status.c b/usr.sbin/ngctl/status.c index a6c6552..9fc5ff1 100644 --- a/usr.sbin/ngctl/status.c +++ b/usr.sbin/ngctl/status.c @@ -71,7 +71,7 @@ StatusCmd(int ac, char **av) path = av[1]; break; default: - return(CMDRTN_USAGE); + return (CMDRTN_USAGE); } /* Get node status summary */ @@ -83,7 +83,7 @@ StatusCmd(int ac, char **av) break; default: warn("send msg"); - return(CMDRTN_ERROR); + return (CMDRTN_ERROR); } } else { if (NgRecvMsg(csock, resp, sizeof(sbuf), NULL) < 0 @@ -96,6 +96,6 @@ StatusCmd(int ac, char **av) printf("No status available for \"%s\"\n", path); else printf("Status for \"%s\":\n%s\n", path, status); - return(CMDRTN_OK); + return (CMDRTN_OK); } diff --git a/usr.sbin/ngctl/types.c b/usr.sbin/ngctl/types.c index 8ed151e..0d5ef18 100644 --- a/usr.sbin/ngctl/types.c +++ b/usr.sbin/ngctl/types.c @@ -68,18 +68,18 @@ TypesCmd(int ac, char **av __unused) case 1: break; default: - return(CMDRTN_USAGE); + return (CMDRTN_USAGE); } /* Get list of types */ if (NgSendMsg(csock, ".", NGM_GENERIC_COOKIE, NGM_LISTTYPES, NULL, 0) < 0) { warn("send msg"); - return(CMDRTN_ERROR); + return (CMDRTN_ERROR); } if (NgAllocRecvMsg(csock, &resp, NULL) < 0) { warn("recv msg"); - return(CMDRTN_ERROR); + return (CMDRTN_ERROR); } /* Show each type */ diff --git a/usr.sbin/ngctl/write.c b/usr.sbin/ngctl/write.c index 288edf66..4114211 100644 --- a/usr.sbin/ngctl/write.c +++ b/usr.sbin/ngctl/write.c @@ -72,16 +72,16 @@ WriteCmd(int ac, char **av) /* Get arguments */ if (ac < 3) - return(CMDRTN_USAGE); + return (CMDRTN_USAGE); hook = av[1]; /* Get data */ if (strcmp(av[2], "-f") == 0) { if (ac != 4) - return(CMDRTN_USAGE); + return (CMDRTN_USAGE); if ((fp = fopen(av[3], "r")) == NULL) { warn("can't read file \"%s\"", av[3]); - return(CMDRTN_ERROR); + return (CMDRTN_ERROR); } if ((len = fread(buf, 1, sizeof(buf), fp)) == 0) { if (ferror(fp)) @@ -89,7 +89,7 @@ WriteCmd(int ac, char **av) else warnx("file \"%s\" is empty", av[3]); fclose(fp); - return(CMDRTN_ERROR); + return (CMDRTN_ERROR); } fclose(fp); } else { @@ -97,12 +97,12 @@ WriteCmd(int ac, char **av) if (sscanf(av[i], "%i", &byte) != 1 || (byte < -128 || byte > 255)) { warnx("invalid byte \"%s\"", av[i]); - return(CMDRTN_ERROR); + return (CMDRTN_ERROR); } buf[len] = (u_char)byte; } if (len == 0) - return(CMDRTN_USAGE); + return (CMDRTN_USAGE); } /* Send data */ @@ -112,10 +112,10 @@ WriteCmd(int ac, char **av) if (sendto(dsock, buf, len, 0, (struct sockaddr *)sag, sag->sg_len) == -1) { warn("writing to hook \"%s\"", hook); - return(CMDRTN_ERROR); + return (CMDRTN_ERROR); } /* Done */ - return(CMDRTN_OK); + return (CMDRTN_OK); } -- cgit v1.1