~ubuntu-branches/ubuntu/raring/virtualbox-ose/raring

« back to all changes in this revision

Viewing changes to src/VBox/Runtime/r3/process.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2011-01-30 23:27:25 UTC
  • mfrom: (0.3.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20110130232725-2ouajjd2ggdet0zd
Tags: 4.0.2-dfsg-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Add Apport hook.
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Drop *-source packages.
* Drop ubuntu-01-fix-build-gcc45.patch, fixed upstream.
* Drop ubuntu-02-as-needed.patch, added to the Debian package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: process.cpp $ */
 
1
/* $Id: process.cpp 33806 2010-11-05 17:20:15Z vboxsync $ */
2
2
/** @file
3
3
 * IPRT - Process, Common.
4
4
 */
91
91
}
92
92
 
93
93
 
94
 
RTR3DECL(char *) RTProcGetExecutableName(char *pszExecName, size_t cchExecName)
 
94
RTR3DECL(char *) RTProcGetExecutablePath(char *pszExecPath, size_t cbExecPath)
95
95
{
96
96
    if (RT_UNLIKELY(g_szrtProcExePath[0] == '\0'))
97
97
        return NULL;
100
100
     * Calc the length and check if there is space before copying.
101
101
     */
102
102
    size_t cch = g_cchrtProcExePath;
103
 
    if (cch < cchExecName)
 
103
    if (cch < cbExecPath)
104
104
    {
105
 
        memcpy(pszExecName, g_szrtProcExePath, cch);
106
 
        pszExecName[cch] = '\0';
107
 
        return pszExecName;
 
105
        memcpy(pszExecPath, g_szrtProcExePath, cch);
 
106
        pszExecPath[cch] = '\0';
 
107
        return pszExecPath;
108
108
    }
109
109
 
110
 
    AssertMsgFailed(("Buffer too small (%zu <= %zu)\n", cchExecName, cch));
 
110
    AssertMsgFailed(("Buffer too small (%zu <= %zu)\n", cbExecPath, cch));
111
111
    return NULL;
112
112
}
113
113
 
 
114
 
 
115
RTR3DECL(const char *) RTProcShortName(void)
 
116
{
 
117
    return &g_szrtProcExePath[g_offrtProcName];
 
118
}
 
119