vserver 1.9.5.x5
[linux-2.6.git] / arch / um / drivers / net_user.c
index 2e4e1d4..47229fe 100644 (file)
@@ -173,10 +173,12 @@ static int change_tramp(char **argv, char *output, int output_len)
        pe_data.stdout = fds[1];
        pid = run_helper(change_pre_exec, &pe_data, argv, NULL);
 
-       os_close_file(fds[1]);
        read_output(fds[0], output, output_len);
+       os_close_file(fds[0]);
+       os_close_file(fds[1]);
 
-       CATCH_EINTR(err = waitpid(pid, NULL, 0));
+       if (pid > 0)
+               CATCH_EINTR(err = waitpid(pid, NULL, 0));
        return(pid);
 }