VirtualBox

Changeset 69753 in vbox for trunk/src/VBox/Runtime/r3/linux


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.)

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  
    5454     * Enumerate /proc.
    5555     */
    56     PRTDIR pDir;
    57     int rc = RTDirOpen(&pDir, "/proc");
     56    RTDIR hDir;
     57    int rc = RTDirOpen(&hDir, "/proc");
    5858    AssertMsgRCReturn(rc, ("RTDirOpen on /proc failed: rc=%Rrc\n", rc), false);
    5959    if (RT_SUCCESS(rc))
    6060    {
    6161        RTDIRENTRY DirEntry;
    62         while (RT_SUCCESS(RTDirRead(pDir, &DirEntry, NULL)))
     62        while (RT_SUCCESS(RTDirRead(hDir, &DirEntry, NULL)))
    6363        {
    6464            /*
     
    104104                    {
    105105                        /* Found it! */
    106                         RTDirClose(pDir);
     106                        RTDirClose(hDir);
    107107                        return true;
    108108                    }
  • 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.

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