Browse Source

Use xmalloc in wait4all (/proc mode)

develop
Damien Goutte-Gattat 8 years ago
parent
commit
0f2765064c
  1. 3
      src/wait4pid.c

3
src/wait4pid.c

@ -183,6 +183,7 @@ wait4all(pid_t *pids, size_t len)
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
#include <xmalloc.h>
int
wait4pid(pid_t pid)
@ -206,7 +207,7 @@ wait4all(pid_t *pids, size_t len)
char *paths;
struct stat st_buf;
paths = malloc(20 * len);
paths = xmalloc(20 * len);
for ( i = 0; i < len; i++ )
snprintf(paths + 20 * i, 20, "/proc/%d", pids[i]);

Loading…
Cancel
Save