Changeset 26114 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Feb 1, 2010 11:13:06 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceTimeSync.cpp
r26113 r26114 435 435 * @param pDrift The time adjustment. 436 436 */ 437 static voidVBoxServiceTimeSyncSet(PCRTTIMESPEC pDrift)437 static bool VBoxServiceTimeSyncSet(PCRTTIMESPEC pDrift) 438 438 { 439 439 /* 440 440 * Query the current time, add the adjustment, then try it. 441 441 */ 442 int rc; 442 443 #ifdef RT_OS_WINDOWS 443 444 RTTIMESPEC hostNow; 444 intrc = VbglR3GetHostTime(&hostNow);445 rc = VbglR3GetHostTime(&hostNow); 445 446 if (RT_FAILURE(rc)) 446 447 { … … 456 457 { 457 458 if (!SetSystemTime(&st)) 458 VBoxServiceError("SetSystemTime failed, error=%u\n", GetLastError()); 459 { 460 rc = RTErrConvertFromWin32(GetLastError()); 461 VBoxServiceError("SetSystemTime failed, error=%Rrc\n", rc); 462 } 463 else rc = VINF_SUCCESS; 459 464 } 460 465 else 461 VBoxServiceError("Cannot convert system times, error=%u\n", GetLastError()); 466 { 467 rc = RTErrConvertFromWin32(GetLastError()); 468 VBoxServiceError("Cannot convert system times, error=%Rrc\n", rc); 469 } 462 470 } 463 471 #else /* !RT_OS_WINDOWS */ … … 481 489 # endif 482 490 g_cTimeSyncErrors = 0; 483 } 484 else if (g_cTimeSyncErrors++ < 10) 485 VBoxServiceError("settimeofday failed; errno=%d: %s\n", errno, strerror(errno)); 486 } 487 else if (g_cTimeSyncErrors++ < 10) 488 VBoxServiceError("gettimeofday failed; errno=%d: %s\n", errno, strerror(errno)); 491 rc = VINF_SUCCESS; 492 } 493 else 494 { 495 rc = RTErrConvertFromErrno(errno); 496 if (g_cTimeSyncErrors++ < 10) 497 VBoxServiceError("settimeofday failed; errno=%d: %s\n", errno, strerror(errno)); 498 } 499 } 500 else 501 { 502 rc = RTErrConvertFromErrno(errno); 503 if (g_cTimeSyncErrors++ < 10) 504 VBoxServiceError("gettimeofday failed; errno=%d: %s\n", errno, strerror(errno)); 505 } 489 506 #endif /* !RT_OS_WINDOWS */ 507 return RT_SUCCESS(rc) ? true : false; 490 508 } 491 509
Note:
See TracChangeset
for help on using the changeset viewer.