VirtualBox

Changeset 4556 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Sep 6, 2007 12:24:45 AM (17 years ago)
Author:
vboxsync
Message:

blanks and (long).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/posix/path-posix.cpp

    r4071 r4556  
    410410        int cchLink = readlink("/proc/self/exe", &g_szrtProgramPath[0], sizeof(g_szrtProgramPath) - 1);
    411411# elif defined(RT_OS_SOLARIS)
    412         pid_t curProcId = getpid();
    413412        char szFileBuf[PATH_MAX + 1];
    414         sprintf(szFileBuf, "/proc/%ld/path/a.out", curProcId);
     413        sprintf(szFileBuf, "/proc/%ld/path/a.out", (long)getpid());
    415414        int cchLink = readlink(szFileBuf, &g_szrtProgramPath[0], sizeof(g_szrtProgramPath) - 1);
    416415# else /* RT_OS_FREEBSD: */
     
    481480
    482481#ifndef RT_OS_L4
    483 /** 
     482/**
    484483 * Worker for RTPathUserHome that looks up the home directory
    485  * using the getpwuid_r api. 
    486  * 
     484 * using the getpwuid_r api.
     485 *
    487486 * @returns IPRT status code.
    488487 * @param   pszPath     The path buffer.
    489488 * @param   cchPath     The size of the buffer.
    490489 * @param   uid         The User ID to query the home directory of.
    491  */ 
     490 */
    492491static int rtPathUserHomeByPasswd(char *pszPath, size_t cchPath, uid_t uid)
    493492{
    494     /* 
    495      * The getpwuid_r function uses the passed in buffer to "allocate" any 
    496      * extra memory it needs. On some systems we should probably use the 
     493    /*
     494     * The getpwuid_r function uses the passed in buffer to "allocate" any
     495     * extra memory it needs. On some systems we should probably use the
    497496     * sysconf function to find the appropriate buffer size, but since it won't
    498      * work everywhere we'll settle with a 5KB buffer and ASSUME that it'll 
    499      * suffice for even the lengthiest user descriptions... 
     497     * work everywhere we'll settle with a 5KB buffer and ASSUME that it'll
     498     * suffice for even the lengthiest user descriptions...
    500499     */
    501500    char            achBuffer[5120];
     
    508507    if (!pPasswd) /* uid not found in /etc/passwd */
    509508        return VERR_PATH_NOT_FOUND;
    510    
     509
    511510    /*
    512511     * Check that it isn't empty and that it exists.
     
    538537
    539538
    540 /** 
     539/**
    541540 * Worker for RTPathUserHome that looks up the home directory
    542  * using the HOME environment variable. 
    543  * 
     541 * using the HOME environment variable.
     542 *
    544543 * @returns IPRT status code.
    545544 * @param   pszPath     The path buffer.
    546545 * @param   cchPath     The size of the buffer.
    547  */ 
     546 */
    548547static int rtPathUserHomeByEnv(char *pszPath, size_t cchPath)
    549548{
     
    554553    const char *pszHome = getenv("HOME");
    555554    if (!pszHome)
    556        
     555
    557556    {
    558557        struct stat st;
     
    596595     else
    597596         rc = rtPathUserHomeByEnv(pszPath, cchPath);
    598      
    599      /* 
     597
     598     /*
    600599      * On failure, retry using the alternative method.
    601600      * (Should perhaps restrict the retry cases a bit more here...)
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