summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/app_dahdiras.c4
-rw-r--r--main/asterisk.c5
-rw-r--r--utils/extconf.c3
3 files changed, 5 insertions, 7 deletions
diff --git a/apps/app_dahdiras.c b/apps/app_dahdiras.c
index 3724f0375..6354ea71d 100644
--- a/apps/app_dahdiras.c
+++ b/apps/app_dahdiras.c
@@ -150,7 +150,7 @@ static void run_ras(struct ast_channel *chan, char *args)
ast_log(LOG_WARNING, "Failed to spawn RAS\n");
} else {
for (;;) {
- res = wait4(pid, &status, WNOHANG, NULL);
+ res = waitpid(pid, &status, WNOHANG);
if (!res) {
/* Check for hangup */
if (ast_check_hangup(chan) && !signalled) {
@@ -163,7 +163,7 @@ static void run_ras(struct ast_channel *chan, char *args)
continue;
}
if (res < 0) {
- ast_log(LOG_WARNING, "wait4 returned %d: %s\n", res, strerror(errno));
+ ast_log(LOG_WARNING, "waitpid returned %d: %s\n", res, strerror(errno));
}
if (WIFEXITED(status)) {
ast_verb(3, "RAS on %s terminated with status %d\n", ast_channel_name(chan), WEXITSTATUS(status));
diff --git a/main/asterisk.c b/main/asterisk.c
index 2e5ffa729..74e36986f 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -1233,7 +1233,6 @@ int ast_safe_system(const char *s)
{
pid_t pid;
int res;
- struct rusage rusage;
int status;
#if defined(HAVE_WORKING_FORK) || defined(HAVE_WORKING_VFORK)
@@ -1265,7 +1264,7 @@ int ast_safe_system(const char *s)
_exit(1);
} else if (pid > 0) {
for (;;) {
- res = wait4(pid, &status, 0, &rusage);
+ res = waitpid(pid, &status, 0);
if (res > -1) {
res = WIFEXITED(status) ? WEXITSTATUS(status) : -1;
break;
@@ -1751,7 +1750,7 @@ static void _child_handler(int sig)
/*
* Reap all dead children -- not just one
*/
- for (n = 0; wait4(-1, &status, WNOHANG, NULL) > 0; n++)
+ for (n = 0; waitpid(-1, &status, WNOHANG) > 0; n++)
;
if (n == 0 && option_debug)
printf("Huh? Child handler, but nobody there?\n");
diff --git a/utils/extconf.c b/utils/extconf.c
index a31fe283a..80491c016 100644
--- a/utils/extconf.c
+++ b/utils/extconf.c
@@ -1330,7 +1330,6 @@ int ast_safe_system(const char *s)
int x;
#endif
int res;
- struct rusage rusage;
int status;
#if defined(HAVE_WORKING_FORK) || defined(HAVE_WORKING_VFORK)
@@ -1352,7 +1351,7 @@ int ast_safe_system(const char *s)
_exit(1);
} else if (pid > 0) {
for(;;) {
- res = wait4(pid, &status, 0, &rusage);
+ res = waitpid(pid, &status, 0);
if (res > -1) {
res = WIFEXITED(status) ? WEXITSTATUS(status) : -1;
break;