| 1963 | } |
| 1964 | |
| 1965 | static int kwsysProcessSetupOutputPipeNative(int* p, int des[2]) |
| 1966 | { |
| 1967 | /* Close the existing descriptor. */ |
| 1968 | kwsysProcessCleanupDescriptor(p); |
| 1969 | |
| 1970 | /* Set close-on-exec flag on the pipe's ends. The proper end will |
| 1971 | be dup2-ed into the standard descriptor number after fork but |
| 1972 | before exec. */ |
| 1973 | if ((fcntl(des[0], F_SETFD, FD_CLOEXEC) < 0) || |
| 1974 | (fcntl(des[1], F_SETFD, FD_CLOEXEC) < 0)) { |
| 1975 | return 0; |
| 1976 | } |
| 1977 | |
| 1978 | /* Assign the replacement descriptor. */ |
| 1979 | *p = des[1]; |
| 1980 | return 1; |
| 1981 | } |
| 1982 | |
| 1983 | /* Get the time at which either the process or user timeout will |
| 1984 | expire. Returns 1 if the user timeout is first, and 0 otherwise. */ |
no test coverage detected
searching dependent graphs…