VirtualBox

Changeset 3388 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Jul 3, 2007 11:42:41 AM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
22586
Message:

Main: Properly daemonize VBoxSVC.exe on OS/2.

Location:
trunk/src/VBox/Main/linux
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/linux/server.cpp

    r3191 r3388  
    984984    }
    985985
     986    static RTFILE pidFile = NIL_RTFILE;
     987
     988#ifdef __OS2__
     989
     990    /* nothing to do here, the process is supposed to be already
     991     * started daemonized when it is necessary */ 
     992    NOREF(fDaemonize);
     993
     994#else // ifdef __OS2__
     995
    986996    static int daemon_pipe_fds[2];
    987     static RTFILE pidFile = NIL_RTFILE;
    988997
    989998    if (fDaemonize)
     
    10461055        close(daemon_pipe_fds[0]);
    10471056    }
     1057
     1058#endif // ifdef __OS2__
    10481059
    10491060#if defined(USE_BACKTRACE)
     
    11611172        {
    11621173            printf ("\nStarting event loop....\n[send TERM signal to quit]\n");
     1174#ifndef __OS2__
    11631175            /* now we're ready, signal the parent process */
    11641176            write(daemon_pipe_fds[1], "READY", strlen("READY"));
     1177#endif
    11651178        }
    11661179        else
     
    12201233    if (fDaemonize)
    12211234    {
     1235#ifndef __OS2__
    12221236        /* close writing end of the pipe as well */
    12231237        close(daemon_pipe_fds[1]);
     1238#endif
    12241239    }
    12251240
  • trunk/src/VBox/Main/linux/server_module.cpp

    r2981 r3388  
    2020 */
    2121
     22#ifdef __OS2__
     23# include <prproces.h>
     24#endif
     25
    2226#include <nsMemory.h>
    2327#include <nsString.h>
     
    165169                startedOnce = true;
    166170
     171#ifdef __OS2__
     172                char *const args[] = { VBoxSVCPath, "--automate", 0 };
     173                /* use NSPR because we want the process to be detached right
     174                 * at startup (it isn't possible to detach it later on) */
     175                PRStatus rv = PR_CreateProcessDetached (VBoxSVCPath,
     176                                                        args, NULL, 0);
     177                if (rv != PR_SUCCESS)
     178                {
     179                    rc = NS_ERROR_FAILURE;
     180                    break;
     181                }
     182#else
     183                const char *args[] = { VBoxSVCPath, "--automate", 0 };
    167184                RTPROCESS pid = NIL_RTPROCESS;
    168                 const char *args[] = { VBoxSVCPath, "--automate", 0 };
    169185                vrc = RTProcCreate (VBoxSVCPath, args, NULL, 0, &pid);
    170186                if (VBOX_FAILURE (vrc))
     
    173189                    break;
    174190                }
     191#endif
    175192
    176193                /* wait for the server process to establish a connection */
Note: See TracChangeset for help on using the changeset viewer.

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