Changeset 32469 in vbox
- Timestamp:
- Sep 14, 2010 10:01:17 AM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 65842
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/USBGetDevices.h
r32324 r32469 57 57 58 58 /** 59 * Free a linked list of USB devices created by the Linux enumeration code. 60 * @param pHead Pointer to the first device in the linked list 61 */ 62 static inline void deviceListFree(PUSBDEVICE *ppHead) 63 { 64 PUSBDEVICE pHead, pNext; 65 pHead = *ppHead; 66 while (pHead) 67 { 68 pNext = pHead->pNext; 69 deviceFree(pHead); 70 pHead = pNext; 71 } 72 *ppHead = NULL; 73 } 74 75 RT_C_DECLS_BEGIN 76 77 /** 59 78 * Check whether @a pcszDevices is a valid usbfs devices file for checking 60 79 * whether usbfs is supported or not. … … 73 92 extern PUSBDEVICE USBProxyLinuxGetDevices(const char *pcszUsbfsRoot); 74 93 94 RT_C_DECLS_END 95 75 96 #endif /* ___USBGetDevices_h */ -
trunk/src/VBox/Main/linux/USBGetDevices.cpp
r32431 r32469 536 536 { 537 537 PUSBDEVICE pFirst = NULL; 538 FILE *pFile ;538 FILE *pFile = NULL; 539 539 int rc; 540 540 rc = openDevicesFile(pcszUsbfsRoot, &pFile); … … 1379 1379 } 1380 1380 if (RT_FAILURE(rc)) 1381 while (pFirst) 1382 { 1383 PUSBDEVICE pNext = pFirst->pNext; 1384 deviceFree(pFirst); 1385 pFirst = pNext; 1386 } 1381 deviceListFree(&pFirst); 1387 1382 1388 1383 VEC_CLEANUP_OBJ(&vecDevInfo);
Note:
See TracChangeset
for help on using the changeset viewer.