diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-11-06 10:06:25 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-11-06 10:06:25 -0600 |
commit | aee5c2ea84efdafc7c568b64265375c5d7154df4 (patch) | |
tree | d0427016578fd4174a83f87158fec04b9ee0c391 /apps | |
parent | 1e2c21de678de30bde7d61405a4bd537ef7269c3 (diff) | |
download | nuttx-aee5c2ea84efdafc7c568b64265375c5d7154df4.tar.gz nuttx-aee5c2ea84efdafc7c568b64265375c5d7154df4.tar.bz2 nuttx-aee5c2ea84efdafc7c568b64265375c5d7154df4.zip |
BAS: Use waitpid() instead of wait() which is not supprted by NuttX
Diffstat (limited to 'apps')
-rw-r--r-- | apps/interpreters/bas/statement.c | 13 |
1 files changed, 9 insertions, 4 deletions
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); } } |