VirtualBox

Changeset 1806 in vbox


Ignore:
Timestamp:
Mar 29, 2007 5:07:44 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
19988
Message:

Main: Don't distinguish between VBoxSVC exe locations when taking a decision whether to start a server process or use an existing (instead, use VBox version number for that). This ensures two build flavors of the samve version will use the same server instance, while two different versions will start two independent VBoxSVC instances.

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

Legend:

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

    r1471 r1806  
    3434#include <nsILocalFile.h>
    3535
     36#include "linux/server.h"
    3637#include "Logging.h"
    3738
     
    998999        }
    9991000
    1000         /* get the executable name (will be used below) */
     1001        /* not really necessary at the moment */
     1002#if 0
    10011003        if (!RTProcGetExecutableName (path, sizeof (path)))
    10021004        {
     
    10041006            break;
    10051007        }
    1006 
    1007         LogFlowFunc (("Will use \"%s\" as server name.\n", path));
     1008#endif
    10081009
    10091010        nsCOMPtr<nsIServiceManager> servMan;
     
    10501051        NS_ADDREF (gIpcServ = ipcServ);
    10511052
    1052         /* use the executable name as the server name */
    1053         rc = gIpcServ->AddName (path);
     1053        LogFlowFunc (("Will use \"%s\" as server name.\n", VBOXSVC_IPC_NAME));
     1054
     1055        rc = gIpcServ->AddName (VBOXSVC_IPC_NAME);
    10541056        if (NS_FAILED (rc))
    10551057        {
  • trunk/src/VBox/Main/linux/server_module.cpp

    r1739 r1806  
    4141#include <VirtualBox_XPCOM.h>
    4242
     43#include "linux/server.h"
    4344#include "Logging.h"
    4445
     
    7273};
    7374
     75/**
     76 *  Full path to the VBoxSVC executable.
     77 */
     78static char VBoxSVCPath [RTPATH_MAX];
     79static bool IsVBoxSVCPathSet = false;
     80
    7481/*
    7582 *  The following macros define the method necessary to provide a list of
     
    8087NS_DECL_CLASSINFO (VirtualBox)
    8188NS_IMPL_CI_INTERFACE_GETTER1 (VirtualBox, IVirtualBox)
    82 
    83 /**
    84  *  Name of the VBoxSVC server-side IPC client.
    85  *
    86  *  This name simply matches the full path to the VBoxSVC executable (to
    87  *  guarantee unicity) so it is also used to start the VBoxSVC process when it
    88  *  is not started.
    89  */
    90 static char VBoxSVCName [RTPATH_MAX];
    91 static bool IsVBoxSVCNameSet = false;
    9289
    9390/**
     
    116113        }
    117114
    118         if (!IsVBoxSVCNameSet)
     115        if (!IsVBoxSVCPathSet)
    119116        {
    120117            /* Get the directory containing XPCOM components -- the VBoxSVC
     
    136133                                 rc = NS_ERROR_FAILURE);
    137134
    138                     strcpy (VBoxSVCName, path.get());
    139                     RTPathStripFilename (VBoxSVCName);
    140                     strcat (VBoxSVCName, VBoxSVC_exe);
     135                    strcpy (VBoxSVCPath, path.get());
     136                    RTPathStripFilename (VBoxSVCPath);
     137                    strcat (VBoxSVCPath, VBoxSVC_exe);
     138
     139                    IsVBoxSVCPathSet = true;
    141140                }
    142141            }
     
    156155        do
    157156        {
    158             LogFlowFunc (("Resolving server name \"%s\"...\n", VBoxSVCName));
     157            LogFlowFunc (("Resolving server name \"%s\"...\n", VBOXSVC_IPC_NAME));
    159158
    160159            PRUint32 serverID = 0;
    161             rc = ipcServ->ResolveClientName (VBoxSVCName, &serverID);
     160            rc = ipcServ->ResolveClientName (VBOXSVC_IPC_NAME, &serverID);
    162161            if (NS_FAILED (rc))
    163162            {
    164                 LogFlowFunc (("Starting server...\n", VBoxSVCName));
     163                LogFlowFunc (("Starting server...\n", VBoxSVCPath));
    165164
    166165                startedOnce = true;
    167166
    168167                RTPROCESS pid = NIL_RTPROCESS;
    169                 const char *args[] = { VBoxSVCName, "--automate", 0 };
    170                 vrc = RTProcCreate (VBoxSVCName, args, NULL, 0, &pid);
     168                const char *args[] = { VBoxSVCPath, "--automate", 0 };
     169                vrc = RTProcCreate (VBoxSVCPath, args, NULL, 0, &pid);
    171170                if (VBOX_FAILURE (vrc))
    172171                {
     
    179178                {
    180179                    RTThreadSleep (VBoxSVC_WaitSlice);
    181                     rc = ipcServ->ResolveClientName (VBoxSVCName, &serverID);
     180                    rc = ipcServ->ResolveClientName (VBOXSVC_IPC_NAME, &serverID);
    182181                    if (NS_SUCCEEDED (rc))
    183182                        break;
     
    218217            {
    219218                nsresult rc2 =
    220                     ipcServ->ResolveClientName (VBoxSVCName, &serverID);
     219                    ipcServ->ResolveClientName (VBOXSVC_IPC_NAME, &serverID);
    221220                if (NS_SUCCEEDED (rc2))
    222221                    break;
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