From aee5c2ea84efdafc7c568b64265375c5d7154df4 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 6 Nov 2014 10:06:25 -0600 Subject: BAS: Use waitpid() instead of wait() which is not supprted by NuttX --- apps/interpreters/bas/statement.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'apps/interpreters') diff --git a/apps/interpreters/bas/statement.c b/apps/interpreters/bas/statement.c index 9fe45126f..eceaad8ca 100644 --- a/apps/interpreters/bas/statement.c +++ b/apps/interpreters/bas/statement.c @@ -1074,6 +1074,7 @@ struct Value *stmt_EDIT(struct Value *value) #ifdef CONFIG_ARCH_HAVE_VFORK long int line; struct Pc statementpc = pc; + int status; ++pc.token; if (pc.token->type == T_INTEGER) @@ -1236,9 +1237,9 @@ struct Value *stmt_EDIT(struct Value *value) default: { - pid_t r; + /* Wait for the editor to complete */ - while ((r = wait((int *)0)) != -1 && r != pid); + while (waitpid((pid, &status, 0) < 0 && errno != EINTR); } } @@ -5721,7 +5722,9 @@ struct Value *stmt_SHELL(struct Value *value) default: { - while (waitpid(pid, &status, 0) == -1 && errno != EINTR); + /* Wait for the shell to complete */ + + while (waitpid(pid, &status, 0) < 0 && errno != EINTR); } } @@ -5766,7 +5769,9 @@ struct Value *stmt_SHELL(struct Value *value) default: { - while (waitpid(pid, &status, 0) == -1 && errno != EINTR); + /* Wait for the shell to complete */ + + while (waitpid(pid, &status, 0) < 0 && errno != EINTR); } } -- cgit v1.2.3