summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authormtm <mtm@FreeBSD.org>2008-06-28 12:31:30 +0000
committermtm <mtm@FreeBSD.org>2008-06-28 12:31:30 +0000
commit688997369e298d1d186c0a26c0f0c1d8408c1ca7 (patch)
tree646745d09b4c2dfb197f7b97453458931a479739 /usr.sbin
parent0488e47726d4370ee948f3b020dbb80270691bf4 (diff)
downloadFreeBSD-src-688997369e298d1d186c0a26c0f0c1d8408c1ca7.zip
FreeBSD-src-688997369e298d1d186c0a26c0f0c1d8408c1ca7.tar.gz
Modify the DoParseCommand() to work on (const char *) instead of just
(char *). This is a slightly simplified version of the patch in the PR. It fixes compilitation issues with -O3. PR: misc/124385
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ngctl/main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/ngctl/main.c b/usr.sbin/ngctl/main.c
index 5747bca..f998513 100644
--- a/usr.sbin/ngctl/main.c
+++ b/usr.sbin/ngctl/main.c
@@ -69,7 +69,7 @@
/* Internal functions */
static int ReadFile(FILE *fp);
static void ReadSockets(fd_set *);
-static int DoParseCommand(char *line);
+static int DoParseCommand(const char *line);
static int DoCommand(int ac, char **av);
static int DoInteractive(void);
static const struct ngcmd *FindCommand(const char *string);
@@ -322,7 +322,7 @@ DoInteractive(void)
history(hist, &hev, H_ENTER, buf);
pthread_kill(monitor, SIGUSR1);
pthread_mutex_lock(&mutex);
- if (DoParseCommand((char *)buf) == CMDRTN_QUIT)
+ if (DoParseCommand(buf) == CMDRTN_QUIT)
break;
pthread_cond_signal(&cond);
pthread_mutex_unlock(&mutex);
@@ -423,13 +423,13 @@ ReadSockets(fd_set *rfds)
* Parse a command line and execute the command
*/
static int
-DoParseCommand(char *line)
+DoParseCommand(const char *line)
{
char *av[MAX_ARGS];
int ac;
/* Parse line */
- for (ac = 0, av[0] = strtok(line, WHITESPACE);
+ for (ac = 0, av[0] = strtok((char *)line, WHITESPACE);
ac < MAX_ARGS - 1 && av[ac];
av[++ac] = strtok(NULL, WHITESPACE));
OpenPOWER on IntegriCloud