VirtualBox

Changeset 50226 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Jan 24, 2014 3:57:37 PM (11 years ago)
Author:
vboxsync
Message:

Runtime/r3/darwin/rtProcInitExePath: use realpath when determining the path of the current binary

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/darwin/rtProcInitExePath-darwin.cpp

    r44528 r50226  
    3333#endif
    3434
     35#include <stdlib.h>
     36#include <limits.h>
     37#include <errno.h>
    3538#include <iprt/string.h>
    3639#include <iprt/assert.h>
     
    4952    AssertReturn(pszImageName, VERR_INTERNAL_ERROR);
    5053
    51     int rc = rtPathFromNativeCopy(pszPath, cchPath, pszImageName, NULL);
     54    char szTmpPath[PATH_MAX + 1];
     55    const char *psz = realpath(pszImageName, szTmpPath);
     56    int rc;
     57    if (psz)
     58        rc = rtPathFromNativeCopy(pszPath, cchPath, szTmpPath, NULL);
     59    else
     60        rc = RTErrConvertFromErrno(errno);
    5261    AssertMsgRCReturn(rc, ("rc=%Rrc pszLink=\"%s\"\nhex: %.*Rhxs\n", rc, pszPath, strlen(pszImageName), pszPath), rc);
    5362
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