app_dahdiras: Use waitpid instead of wait4.

Several places in the code were using wait4 while other places were using
waitpid.  This change makes all places use waitpid in order to make things
more consistent and since the 'rusage' object passed in/out of wait4 was
never used.

(closes issue ASTERISK-22557)
Reported by: YvesGael
Patches:
     asterisk-11.5.1-wait4.patch uploaded by hurdman (license 6537)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402546 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin Harwell
2013-11-08 14:58:13 +00:00
parent 3c645e8520
commit 2564ed26f7
3 changed files with 5 additions and 7 deletions

View File

@@ -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;