VirtualBox

Ticket #8686: chdir_to_root.diff

File chdir_to_root.diff, 828 bytes (added by blade, 13 years ago)
  • src/VBox/Main/src-server/xpcom/server_module.cpp

    old new  
    5656
    5757#include <string.h>
    5858
     59#if (defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD))
     60#include <unistd.h>
     61#define _CHDIR(x) chdir(x)
     62#else
     63#define _CHDIR(x)
     64#endif
     65
     66
    5967#if defined(RT_OS_SOLARIS)
    6068# include <sys/systeminfo.h>
    6169#endif
     
    125133    PR_ProcessAttrSetStdioRedirect(attr, PR_StandardOutput, devNull);
    126134    PR_ProcessAttrSetStdioRedirect(attr, PR_StandardError, devNull);
    127135
     136    // don't keep open descriptors on the startup dir while the client runs
     137    _CHDIR("/");
     138
    128139    if (PR_CreateProcessDetached(VBoxSVCPath, args, nsnull, attr) != PR_SUCCESS)
    129140        goto end;
    130141

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