Changeset 69753 in vbox for trunk/src/VBox/Runtime/r3/linux/krnlmod-linux.cpp
- Timestamp:
- Nov 19, 2017 2:27:58 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 119153
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.