VirtualBox

Changeset 3071 in kBuild


Ignore:
Timestamp:
Oct 2, 2017 8:14:40 AM (7 years ago)
Author:
bird
Message:

redirect.c: solaris 10 build fix (no O_CLOEXEC flag)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/kmkbuiltin/redirect.c

    r3056 r3071  
    4747# include <unistd.h>
    4848# include <spawn.h>
     49# include <sys/wait.h>
    4950#endif
    5051
     
    384385    int const   fNoInherit = O_CLOEXEC;
    385386#else
    386 # error "port me"
     387    int const   fNoInherit = 0;
     388# define USE_FD_CLOEXEC
    387389#endif
    388390    int         aFdTries[32];
     
    406408            return fdOpened;
    407409#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
    409413            return fdOpened;
    410414#endif
     
    428432            {
    429433#ifndef _MSC_VER
     434# ifdef USE_FD_CLOEXEC
     435                if (   fdOpened == fdTarget
     436                    || fcntl(fdOpened, F_SETFD, FD_CLOEXEC) != -1)
     437# else
    430438                if (   fdOpened != fdTarget
    431                     || fcntl(fdOpened, F_SETFD, FD_CLOEXEC) != -1)
     439                    || fcntl(fdOpened, F_SETFD, 0) != -1)
     440# endif
    432441#endif
    433442                {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette