diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2016-12-22 17:37:49 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2016-12-22 17:37:49 +0200 |
commit | af6f677758c6b873fb3130b34705e2a705270a75 (patch) | |
tree | 64de0a1c1d969e5ce687e873535637c117d60935 /extension/fork.c | |
parent | 293b5a86a9053668773e75b35682c41ca64e0db6 (diff) | |
parent | cd820dc4359b8dc1a40fedc0c5d3924ed8f88df0 (diff) | |
download | egawk-af6f677758c6b873fb3130b34705e2a705270a75.tar.gz egawk-af6f677758c6b873fb3130b34705e2a705270a75.tar.bz2 egawk-af6f677758c6b873fb3130b34705e2a705270a75.zip |
Merge branch 'feature/regex-to-api' into feature/andy
Diffstat (limited to 'extension/fork.c')
-rw-r--r-- | extension/fork.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/extension/fork.c b/extension/fork.c index 82593b7f..823506dd 100644 --- a/extension/fork.c +++ b/extension/fork.c @@ -71,15 +71,12 @@ array_set_numeric(awk_array_t array, const char *sub, double num) /* do_fork --- provide dynamically loaded fork() builtin for gawk */ static awk_value_t * -do_fork(int nargs, awk_value_t *result) +do_fork(int nargs, awk_value_t *result, struct awk_ext_func *unused) { int ret = -1; assert(result != NULL); - if (do_lint && nargs > 0) - lintwarn(ext_id, _("fork: called with too many arguments")); - ret = fork(); if (ret < 0) @@ -106,7 +103,7 @@ do_fork(int nargs, awk_value_t *result) /* do_waitpid --- provide dynamically loaded waitpid() builtin for gawk */ static awk_value_t * -do_waitpid(int nargs, awk_value_t *result) +do_waitpid(int nargs, awk_value_t *result, struct awk_ext_func *unused) { awk_value_t pid; int ret = -1; @@ -114,16 +111,12 @@ do_waitpid(int nargs, awk_value_t *result) assert(result != NULL); - if (do_lint && nargs > 1) - lintwarn(ext_id, _("waitpid: called with too many arguments")); - if (get_argument(0, AWK_NUMBER, &pid)) { options = WNOHANG|WUNTRACED; ret = waitpid(pid.num_value, NULL, options); if (ret < 0) update_ERRNO_int(errno); - } else if (do_lint) - lintwarn(ext_id, _("wait: called with no arguments")); + } /* Set the return value */ return make_number(ret, result); @@ -133,15 +126,12 @@ do_waitpid(int nargs, awk_value_t *result) /* do_wait --- provide dynamically loaded wait() builtin for gawk */ static awk_value_t * -do_wait(int nargs, awk_value_t *result) +do_wait(int nargs, awk_value_t *result, struct awk_ext_func *unused) { int ret; assert(result != NULL); - if (do_lint && nargs > 0) - lintwarn(ext_id, _("wait: called with too many arguments")); - ret = wait(NULL); if (ret < 0) update_ERRNO_int(errno); @@ -151,9 +141,9 @@ do_wait(int nargs, awk_value_t *result) } static awk_ext_func_t func_table[] = { - { "fork", do_fork, 0 }, - { "waitpid", do_waitpid, 1 }, - { "wait", do_wait, 0 }, + { "fork", do_fork, 0, 0, awk_false, NULL }, + { "waitpid", do_waitpid, 1, 1, awk_false, NULL }, + { "wait", do_wait, 0, 0, awk_false, NULL }, }; /* define the dl_load function using the boilerplate macro */ |