Changeset 3071 in kBuild
- Timestamp:
- Oct 2, 2017 8:14:40 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/kmkbuiltin/redirect.c
r3056 r3071 47 47 # include <unistd.h> 48 48 # include <spawn.h> 49 # include <sys/wait.h> 49 50 #endif 50 51 … … 384 385 int const fNoInherit = O_CLOEXEC; 385 386 #else 386 # error "port me" 387 int const fNoInherit = 0; 388 # define USE_FD_CLOEXEC 387 389 #endif 388 390 int aFdTries[32]; … … 406 408 return fdOpened; 407 409 #ifndef _MSC_VER /* Stupid, stupid MSVCRT! No friggin way of making a handle inheritable (or not). */ 408 if (fcntl(fdOpened, F_SETFD, FD_CLOEXEC) != -1) 410 # ifndef USE_FD_CLOEXEC 411 if (fcntl(fdOpened, F_SETFD, 0) != -1) 412 # endif 409 413 return fdOpened; 410 414 #endif … … 428 432 { 429 433 #ifndef _MSC_VER 434 # ifdef USE_FD_CLOEXEC 435 if ( fdOpened == fdTarget 436 || fcntl(fdOpened, F_SETFD, FD_CLOEXEC) != -1) 437 # else 430 438 if ( fdOpened != fdTarget 431 || fcntl(fdOpened, F_SETFD, FD_CLOEXEC) != -1) 439 || fcntl(fdOpened, F_SETFD, 0) != -1) 440 # endif 432 441 #endif 433 442 {
Note:
See TracChangeset
for help on using the changeset viewer.