Changeset 38633 in vbox
- Timestamp:
- Sep 5, 2011 11:33:01 AM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 73840
- Location:
- trunk/src/VBox/Additions/common/VBoxService
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxService.cpp
r38223 r38633 218 218 * 219 219 * @returns 1 220 * @param iLevel Minimum log level required to display this message. 220 221 * @param pszFormat The message text. 221 222 * @param ... Format arguments. … … 223 224 void VBoxServiceVerbose(int iLevel, const char *pszFormat, ...) 224 225 { 226 if (iLevel <= g_cVerbosity) 227 { 225 228 #ifdef DEBUG 226 int rc = RTCritSectEnter(&g_csLog); 227 if (RT_SUCCESS(rc)) 228 { 229 #endif 230 if (iLevel <= g_cVerbosity) 231 { 232 #ifdef DEBUG 229 int rc = RTCritSectEnter(&g_csLog); 230 if (RT_SUCCESS(rc)) 231 { 233 232 const char *pszThreadName = RTThreadSelfName(); 234 233 AssertPtr(pszThreadName); … … 245 244 LogRel(("%s: %N", g_pszProgName, pszFormat, &va)); 246 245 va_end(va); 246 #ifdef DEBUG 247 RTCritSectLeave(&g_csLog); 247 248 } 248 #ifdef DEBUG 249 int rc2 = RTCritSectLeave(&g_csLog); 250 if (RT_SUCCESS(rc)) 251 rc = rc2; 252 } 253 #endif 249 #endif 250 } 254 251 } 255 252 -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlExec.cpp
r38629 r38633 612 612 && cbRead) 613 613 { 614 VBoxServiceVerbose(5, "[%u]: %s\n", pData->uPID, szBuf); 614 #ifdef DEBUG 615 int rc2 = RTCritSectEnter(&g_csLog); 616 if (RT_SUCCESS(rc2)) 617 { 618 #endif 619 RTStrmWriteEx(g_pStdOut, szBuf, cbRead, NULL /* No partial write. */); 620 #ifdef DEBUG 621 rc2 = RTCritSectLeave(&g_csLog); 622 if (RT_SUCCESS(rc)) 623 rc = rc2; 624 } 625 #endif 615 626 cbOffset += cbRead; 616 627 if (!cbLeft) -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceInternal.h
r38587 r38633 276 276 extern VBOXSERVICE g_AutoMount; 277 277 #endif 278 #ifdef DEBUG 279 extern RTCRITSECT g_csLog; /* For guest process stdout dumping. */ 280 #endif 278 281 279 282 extern RTEXITCODE VBoxServiceSyntax(const char *pszFormat, ...); -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceToolBox.cpp
r38625 r38633 1185 1185 1186 1186 /* 1187 * The input is ASSUMED to be in the current process codeset (NT guarantees 1188 * ACP, unixy systems doesn't guarantee anything). This loop converts all 1189 * the argv[*] strings to UTF-8, which is a tad ugly but who cares. 1190 * (As a rule all strings in VirtualBox are UTF-8.) 1191 */ 1192 for (int i = 0; i < argc; i++) 1193 { 1194 char *pszConverted; 1195 int rc = RTStrCurrentCPToUtf8(&pszConverted, argv[i]); 1196 if (RT_SUCCESS(rc)) 1197 argv[i] = pszConverted; 1198 else 1199 { 1200 RTMsgError("Failed to convert argument %d to UTF-8, rc=%Rrc\n", 1201 i + 1, rc); 1202 1203 /* Conversion was not possible,probably due to invalid characters. 1204 * Keep in mind that we do RTStrFree on the whole array below. */ 1205 argv[i] = RTStrDup(argv[i]); 1206 } 1207 } 1208 1209 /* 1187 1210 * Invoke the handler. 1188 1211 */ 1189 1212 RTMsgSetProgName("VBoxService/%s", pszTool); 1190 1213 *prcExit = pfnHandler(argc, argv); 1214 1215 /* 1216 * Free converted argument vector 1217 */ 1218 for (int i = 0; i < argc; i++) 1219 { 1220 RTStrFree(argv[i]); 1221 argv[i] = NULL; 1222 } 1191 1223 return true; 1192 1224
Note:
See TracChangeset
for help on using the changeset viewer.