Changeset 1806 in vbox
- Timestamp:
- Mar 29, 2007 5:07:44 PM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 19988
- Location:
- trunk/src/VBox/Main/linux
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/linux/server.cpp
r1471 r1806 34 34 #include <nsILocalFile.h> 35 35 36 #include "linux/server.h" 36 37 #include "Logging.h" 37 38 … … 998 999 } 999 1000 1000 /* get the executable name (will be used below) */ 1001 /* not really necessary at the moment */ 1002 #if 0 1001 1003 if (!RTProcGetExecutableName (path, sizeof (path))) 1002 1004 { … … 1004 1006 break; 1005 1007 } 1006 1007 LogFlowFunc (("Will use \"%s\" as server name.\n", path)); 1008 #endif 1008 1009 1009 1010 nsCOMPtr<nsIServiceManager> servMan; … … 1050 1051 NS_ADDREF (gIpcServ = ipcServ); 1051 1052 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); 1054 1056 if (NS_FAILED (rc)) 1055 1057 { -
trunk/src/VBox/Main/linux/server_module.cpp
r1739 r1806 41 41 #include <VirtualBox_XPCOM.h> 42 42 43 #include "linux/server.h" 43 44 #include "Logging.h" 44 45 … … 72 73 }; 73 74 75 /** 76 * Full path to the VBoxSVC executable. 77 */ 78 static char VBoxSVCPath [RTPATH_MAX]; 79 static bool IsVBoxSVCPathSet = false; 80 74 81 /* 75 82 * The following macros define the method necessary to provide a list of … … 80 87 NS_DECL_CLASSINFO (VirtualBox) 81 88 NS_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 (to87 * guarantee unicity) so it is also used to start the VBoxSVC process when it88 * is not started.89 */90 static char VBoxSVCName [RTPATH_MAX];91 static bool IsVBoxSVCNameSet = false;92 89 93 90 /** … … 116 113 } 117 114 118 if (!IsVBoxSVC NameSet)115 if (!IsVBoxSVCPathSet) 119 116 { 120 117 /* Get the directory containing XPCOM components -- the VBoxSVC … … 136 133 rc = NS_ERROR_FAILURE); 137 134 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; 141 140 } 142 141 } … … 156 155 do 157 156 { 158 LogFlowFunc (("Resolving server name \"%s\"...\n", VB oxSVCName));157 LogFlowFunc (("Resolving server name \"%s\"...\n", VBOXSVC_IPC_NAME)); 159 158 160 159 PRUint32 serverID = 0; 161 rc = ipcServ->ResolveClientName (VB oxSVCName, &serverID);160 rc = ipcServ->ResolveClientName (VBOXSVC_IPC_NAME, &serverID); 162 161 if (NS_FAILED (rc)) 163 162 { 164 LogFlowFunc (("Starting server...\n", VBoxSVC Name));163 LogFlowFunc (("Starting server...\n", VBoxSVCPath)); 165 164 166 165 startedOnce = true; 167 166 168 167 RTPROCESS pid = NIL_RTPROCESS; 169 const char *args[] = { VBoxSVC Name, "--automate", 0 };170 vrc = RTProcCreate (VBoxSVC Name, args, NULL, 0, &pid);168 const char *args[] = { VBoxSVCPath, "--automate", 0 }; 169 vrc = RTProcCreate (VBoxSVCPath, args, NULL, 0, &pid); 171 170 if (VBOX_FAILURE (vrc)) 172 171 { … … 179 178 { 180 179 RTThreadSleep (VBoxSVC_WaitSlice); 181 rc = ipcServ->ResolveClientName (VB oxSVCName, &serverID);180 rc = ipcServ->ResolveClientName (VBOXSVC_IPC_NAME, &serverID); 182 181 if (NS_SUCCEEDED (rc)) 183 182 break; … … 218 217 { 219 218 nsresult rc2 = 220 ipcServ->ResolveClientName (VB oxSVCName, &serverID);219 ipcServ->ResolveClientName (VBOXSVC_IPC_NAME, &serverID); 221 220 if (NS_SUCCEEDED (rc2)) 222 221 break;
Note:
See TracChangeset
for help on using the changeset viewer.