summaryrefslogtreecommitdiff
path: root/usr.sbin/ngctl
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2006-06-28 10:38:38 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2006-06-28 10:38:38 +0000
commit9caee2ece77615135bbc2531d21b62e81aed5cb5 (patch)
tree16ce781a472dce81e91d090c2bbbc51ec55cb152 /usr.sbin/ngctl
parentfe0e43d648385f9004df9fffb9f53966dc671710 (diff)
downloadsrc-test-9caee2ece77615135bbc2531d21b62e81aed5cb5.tar.gz
src-test-9caee2ece77615135bbc2531d21b62e81aed5cb5.zip
Style: space after "return".
Notes
Notes: svn path=/head/; revision=160002
Diffstat (limited to 'usr.sbin/ngctl')
-rw-r--r--usr.sbin/ngctl/config.c6
-rw-r--r--usr.sbin/ngctl/connect.c6
-rw-r--r--usr.sbin/ngctl/debug.c6
-rw-r--r--usr.sbin/ngctl/list.c8
-rw-r--r--usr.sbin/ngctl/main.c34
-rw-r--r--usr.sbin/ngctl/mkpeer.c6
-rw-r--r--usr.sbin/ngctl/msg.c8
-rw-r--r--usr.sbin/ngctl/name.c6
-rw-r--r--usr.sbin/ngctl/rmhook.c6
-rw-r--r--usr.sbin/ngctl/show.c10
-rw-r--r--usr.sbin/ngctl/shutdown.c6
-rw-r--r--usr.sbin/ngctl/status.c6
-rw-r--r--usr.sbin/ngctl/types.c6
-rw-r--r--usr.sbin/ngctl/write.c16
14 files changed, 65 insertions, 65 deletions
diff --git a/usr.sbin/ngctl/config.c b/usr.sbin/ngctl/config.c
index edd47d10f7cff..739a6934b83f1 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 a9e16f1b298fd..cd5307e499c22 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 4fa074d960448..491bfb41378d4 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 7f12434a9f17f..966a8a567e36f 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 ecf4caba9b041..a09a0cf1291d0 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 083a6277576f1..77c43a31eb55b 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 fa5ae29e07c41..c332879a0ac3f 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 92736a72c4bb9..a557134ce8dcd 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 ba63a9efac14b..9a47a9d66fdfe 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 e60830a97ef2e..5232645bbcae6 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 e5679dda7b0e8..b06beb5ca0ff9 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 a6c6552fca2af..9fc5ff1ea2c02 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 8ed151e065231..0d5ef1811134d 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 288edf6600a3c..4114211705c60 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);
}