Changeset 35055 in vbox
- Timestamp:
- Dec 14, 2010 9:35:29 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceAutoMount.cpp
r35016 r35055 150 150 } 151 151 #endif 152 153 VBoxServiceVerbose(4, "VBoxServiceAutoMountShareIsMounted: Share \"%s\" at mount point \"%s\" = %s\n", 154 pszShare, fMounted ? pszMountPoint : "<None>", fMounted ? "Yes" : "No"); 152 155 return fMounted; 153 156 } … … 190 193 rc = RTPathSetMode(pszMountPoint, fMode); 191 194 if (RT_FAILURE(rc)) 192 VBoxServiceError("VBoxServiceAutoMountPrepareMountPoint: Could not set mode %RTfmode for mount directory \"%s\", rc = %Rrc\n", 193 fMode, pszMountPoint, rc); 195 { 196 if (rc == VERR_WRITE_PROTECT) 197 { 198 VBoxServiceError("VBoxServiceAutoMountPrepareMountPoint: Mount directory \"%s\" already is used/mounted\n", pszMountPoint); 199 rc = VINF_SUCCESS; 200 } 201 else 202 VBoxServiceError("VBoxServiceAutoMountPrepareMountPoint: Could not set mode %RTfmode for mount directory \"%s\", rc = %Rrc\n", 203 fMode, pszMountPoint, rc); 204 } 194 205 } 195 206 else … … 368 379 } 369 380 370 static int VBoxServiceAutoMountProcessMappings(PVBGLR3SHAREDFOLDERMAPPING paMappings, uint32_t cMappings, 381 static int VBoxServiceAutoMountProcessMappings(PVBGLR3SHAREDFOLDERMAPPING paMappings, uint32_t cMappings, 371 382 const char *pszMountDir, const char *pszSharePrefix, uint32_t uClientID) 372 383 { … … 376 387 AssertPtrReturn(pszMountDir, VERR_INVALID_PARAMETER); 377 388 AssertPtrReturn(pszSharePrefix, VERR_INVALID_PARAMETER); 378 AssertPtrReturn(*pszSharePrefix, VERR_INVALID_PARAMETER);379 389 AssertReturn(uClientID > 0, VERR_INVALID_PARAMETER); 380 390 … … 391 401 char *pszShareNameFull = NULL; 392 402 if (RTStrAPrintf(&pszShareNameFull, "%s%s", pszSharePrefix, pszShareName) > 0) 393 { 403 { 394 404 char szMountPoint[RTPATH_MAX]; 395 405 rc = RTPathJoin(szMountPoint, sizeof(szMountPoint), pszMountDir, pszShareNameFull); … … 397 407 { 398 408 VBoxServiceVerbose(4, "VBoxServiceAutoMountWorker: Processing mount point \"%s\"\n", szMountPoint); 399 409 400 410 struct group *grp_vboxsf = getgrnam("vboxsf"); 401 411 if (grp_vboxsf) … … 418 428 NULL, /* convertcp */ 419 429 }; 420 421 /* We always use "/media" as our root mounting directory. */ 422 /** @todo Detect the correct "media/mnt" directory, based on the current guest (?). */ 430 423 431 rc = VBoxServiceAutoMountSharedFolder(pszShareName, szMountPoint, &mount_opts); 424 432 } … … 462 470 rc = VbglR3SharedFolderGetMappings(u32ClientId, true /* Only process auto-mounted folders */, 463 471 &paMappings, &cMappings); 464 if (RT_SUCCESS(rc)) 472 if ( RT_SUCCESS(rc) 473 && cMappings) 465 474 { 466 475 char *pszMountDir; … … 474 483 char *pszSharePrefix; 475 484 rc = VbglR3SharedFolderGetMountPrefix(&pszSharePrefix); 476 477 {478 }479 485 if (RT_SUCCESS(rc)) 480 486 { … … 501 507 } 502 508 else 503 VBoxServiceError("VBoxServiceAutoMountWorker: Error while getting the shared folder directory, rc = %Rrc\n", rc); 509 VBoxServiceError("VBoxServiceAutoMountWorker: Error while getting the shared folder directory, rc = %Rrc\n", rc); 504 510 RTMemFree(paMappings); 505 511 } 506 512 else 507 VBoxServiceError("VBoxServiceAutoMountWorker: Error while getting the shared folder mappings, rc = %Rrc\n", rc); 513 { 514 if (RT_FAILURE(rc)) 515 VBoxServiceError("VBoxServiceAutoMountWorker: Error while getting the shared folder mappings, rc = %Rrc\n", rc); 516 else if (!cMappings) 517 VBoxServiceVerbose(3, "VBoxServiceAutoMountWorker: No shared folder mappings fouund\n"); 518 } 508 519 VbglR3SharedFolderDisconnect(u32ClientId); 509 520 } … … 512 523 g_AutoMountEvent = NIL_RTSEMEVENTMULTI; 513 524 514 VBoxServiceVerbose(3, "VBoxServiceAutoMountWorker: Finished \n");515 return 0;525 VBoxServiceVerbose(3, "VBoxServiceAutoMountWorker: Finished with rc=%Rrc\n", rc); 526 return VINF_SUCCESS; 516 527 } 517 528
Note:
See TracChangeset
for help on using the changeset viewer.