Deal with multithreading by waiting specifically for the pid we cloned.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
* Parent: wait for child to return, in which case the
* shared memory map will have been created.
*/
- pid = wait(&status);
+ pid = waitpid(pid, &status, 0);
if (pid < 0 || !WIFEXITED(status) || WEXITSTATUS(status) != 0) {
perror("wait");
ret = -1;
{
struct open_data data;
+ DBG3("open() %s with flags %X mode %d for uid %d and gid %d",
+ path, flags, mode, uid, gid);
data.path = path;
data.flags = flags;
data.mode = mode;