VirtualBox

Ignore:
Timestamp:
Nov 19, 2017 2:27:58 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
119153
Message:

iprt/dir: Morphing PRTDIR into a handle named RTDIR. (Been wanting to correct this for years. Don't know why I makde it a pointer rather than an abstrct handle like everything else.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/linux/krnlmod-linux.cpp

    r67286 r69753  
    172172    uint32_t cKmodsLoaded = 0;
    173173
    174     PRTDIR pDir = NULL;
    175     int rc = RTDirOpen(&pDir, "/sys/module");
     174    RTDIR hDir = NULL;
     175    int rc = RTDirOpen(&hDir, "/sys/module");
    176176    if (RT_SUCCESS(rc))
    177177    {
    178178        RTDIRENTRY DirEnt;
    179         rc = RTDirRead(pDir, &DirEnt, NULL);
     179        rc = RTDirRead(hDir, &DirEnt, NULL);
    180180        while (RT_SUCCESS(rc))
    181181        {
    182             if (   RTStrCmp(DirEnt.szName, ".")
    183                 && RTStrCmp(DirEnt.szName, ".."))
     182            if (!RTDirEntryIsStdDotLink(&DirEntry))
    184183                cKmodsLoaded++;
    185             rc = RTDirRead(pDir, &DirEnt, NULL);
     184            rc = RTDirRead(hDir, &DirEnt, NULL);
    186185        }
    187186
    188         RTDirClose(pDir);
     187        RTDirClose(hDir);
    189188    }
    190189
     
    207206    }
    208207
    209     PRTDIR pDir = NULL;
     208    RTDIR hDir = NULL;
    210209    int rc = RTDirOpen(&pDir, "/sys/module");
    211210    if (RT_SUCCESS(rc))
     
    214213        RTDIRENTRY DirEnt;
    215214
    216         rc = RTDirRead(pDir, &DirEnt, NULL);
     215        rc = RTDirRead(hDir, &DirEnt, NULL);
    217216        while (RT_SUCCESS(rc))
    218217        {
    219             if (   RTStrCmp(DirEnt.szName, ".")
    220                 && RTStrCmp(DirEnt.szName, ".."))
     218            if (!RTDirEntryIsStdDotLink(&DirEnt))
    221219            {
    222220                rc = rtKrnlModLinuxInfoCreate(DirEnt.szName, &pahKrnlModInfo[idxKrnlModInfo]);
     
    226224
    227225            if (RT_SUCCESS(rc))
    228                 rc = RTDirRead(pDir, &DirEnt, NULL);
     226                rc = RTDirRead(hDir, &DirEnt, NULL);
    229227        }
    230228
     
    241239            *pcEntries = cKmodsLoaded;
    242240
    243         RTDirClose(pDir);
     241        RTDirClose(hDir);
    244242    }
    245243
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette