Changeset 69753 in vbox for trunk/src/VBox/Runtime/r3/linux
- Timestamp:
- Nov 19, 2017 2:27:58 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 119153
- Location:
- trunk/src/VBox/Runtime/r3/linux
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/linux/RTProcIsRunningByName-linux.cpp
r69111 r69753 54 54 * Enumerate /proc. 55 55 */ 56 PRTDIR pDir;57 int rc = RTDirOpen(& pDir, "/proc");56 RTDIR hDir; 57 int rc = RTDirOpen(&hDir, "/proc"); 58 58 AssertMsgRCReturn(rc, ("RTDirOpen on /proc failed: rc=%Rrc\n", rc), false); 59 59 if (RT_SUCCESS(rc)) 60 60 { 61 61 RTDIRENTRY DirEntry; 62 while (RT_SUCCESS(RTDirRead( pDir, &DirEntry, NULL)))62 while (RT_SUCCESS(RTDirRead(hDir, &DirEntry, NULL))) 63 63 { 64 64 /* … … 104 104 { 105 105 /* Found it! */ 106 RTDirClose( pDir);106 RTDirClose(hDir); 107 107 return true; 108 108 } -
trunk/src/VBox/Runtime/r3/linux/krnlmod-linux.cpp
r67286 r69753 172 172 uint32_t cKmodsLoaded = 0; 173 173 174 PRTDIR pDir = NULL;175 int rc = RTDirOpen(& pDir, "/sys/module");174 RTDIR hDir = NULL; 175 int rc = RTDirOpen(&hDir, "/sys/module"); 176 176 if (RT_SUCCESS(rc)) 177 177 { 178 178 RTDIRENTRY DirEnt; 179 rc = RTDirRead( pDir, &DirEnt, NULL);179 rc = RTDirRead(hDir, &DirEnt, NULL); 180 180 while (RT_SUCCESS(rc)) 181 181 { 182 if ( RTStrCmp(DirEnt.szName, ".") 183 && RTStrCmp(DirEnt.szName, "..")) 182 if (!RTDirEntryIsStdDotLink(&DirEntry)) 184 183 cKmodsLoaded++; 185 rc = RTDirRead( pDir, &DirEnt, NULL);184 rc = RTDirRead(hDir, &DirEnt, NULL); 186 185 } 187 186 188 RTDirClose( pDir);187 RTDirClose(hDir); 189 188 } 190 189 … … 207 206 } 208 207 209 PRTDIR pDir = NULL;208 RTDIR hDir = NULL; 210 209 int rc = RTDirOpen(&pDir, "/sys/module"); 211 210 if (RT_SUCCESS(rc)) … … 214 213 RTDIRENTRY DirEnt; 215 214 216 rc = RTDirRead( pDir, &DirEnt, NULL);215 rc = RTDirRead(hDir, &DirEnt, NULL); 217 216 while (RT_SUCCESS(rc)) 218 217 { 219 if ( RTStrCmp(DirEnt.szName, ".") 220 && RTStrCmp(DirEnt.szName, "..")) 218 if (!RTDirEntryIsStdDotLink(&DirEnt)) 221 219 { 222 220 rc = rtKrnlModLinuxInfoCreate(DirEnt.szName, &pahKrnlModInfo[idxKrnlModInfo]); … … 226 224 227 225 if (RT_SUCCESS(rc)) 228 rc = RTDirRead( pDir, &DirEnt, NULL);226 rc = RTDirRead(hDir, &DirEnt, NULL); 229 227 } 230 228 … … 241 239 *pcEntries = cKmodsLoaded; 242 240 243 RTDirClose( pDir);241 RTDirClose(hDir); 244 242 } 245 243
Note:
See TracChangeset
for help on using the changeset viewer.