diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2012-06-17 20:47:50 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2012-06-17 20:47:50 +0300 |
commit | 5e79fa8735ec2984fee9054cccd51d86fa939621 (patch) | |
tree | f4bfe5ed9667c55949f47433917cf8343a450c77 /extension/fork.c | |
parent | 2c698c5eb4294783e821e986c74e55b63507c790 (diff) | |
download | egawk-5e79fa8735ec2984fee9054cccd51d86fa939621.tar.gz egawk-5e79fa8735ec2984fee9054cccd51d86fa939621.tar.bz2 egawk-5e79fa8735ec2984fee9054cccd51d86fa939621.zip |
Still more API and testext.c work.
Diffstat (limited to 'extension/fork.c')
-rw-r--r-- | extension/fork.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/extension/fork.c b/extension/fork.c index 0c2e31d0..21a4145f 100644 --- a/extension/fork.c +++ b/extension/fork.c @@ -26,9 +26,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include <stdlib.h> #include <stdio.h> +#include <assert.h> #include <errno.h> +#include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/wait.h> @@ -67,7 +68,9 @@ do_fork(int nargs, awk_value_t *result) { int ret = -1; - if (do_lint && nargs > 0) + assert(result != NULL); + + if (do_lint && nargs > 0) lintwarn(ext_id, "fork: called with too many arguments"); ret = fork(); @@ -102,7 +105,9 @@ do_waitpid(int nargs, awk_value_t *result) int ret = -1; int options = 0; - if (do_lint && nargs > 1) + assert(result != NULL); + + if (do_lint && nargs > 1) lintwarn(ext_id, "waitpid: called with too many arguments"); if (get_argument(0, AWK_NUMBER, &pid)) { @@ -125,7 +130,9 @@ do_wait(int nargs, awk_value_t *result) { int ret; - if (do_lint && nargs > 0) + assert(result != NULL); + + if (do_lint && nargs > 0) lintwarn(ext_id, "wait: called with too many arguments"); ret = wait(NULL); |