Changeset 11836 in vbox
- Timestamp:
- Aug 29, 2008 4:52:20 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 35668
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/path.h
r10911 r11836 231 231 */ 232 232 RTDECL(void) RTPathStripTrailingSlash(char *pszPath); 233 234 /** 235 * Parses a path. 236 * 237 * It figures the length of the directory component, the offset of 238 * the file name and the location of the suffix dot. 239 * 240 * @returns The path length. 241 * 242 * @param pszPath Path to find filename in. 243 * @param pcbDir Where to put the length of the directory component. 244 * If no directory, this will be 0. Optional. 245 * @param poffName Where to store the filename offset. 246 * If empty string or if it's ending with a slash this 247 * will be set to -1. Optional. 248 * @param poffSuff Where to store the suffix offset (the last dot). 249 * If empty string or if it's ending with a slash this 250 * will be set to -1. Optional. 251 * @param pfFlags Where to set flags returning more information about 252 * the path. For the future. Optional. 253 */ 254 RTDECL(size_t) RTPathParse(const char *pszPath, size_t *pcchDir, ssize_t *poffName, ssize_t *poffSuff); 233 255 234 256 /** -
trunk/src/VBox/Runtime/Makefile.kmk
r11814 r11836 310 310 r3/win/process-win.cpp \ 311 311 r3/win/RTLogWriteDebugger-win.cpp \ 312 r3/win/rtProcInitExePath-win.cpp \ 312 313 r3/win/sched-win.cpp \ 313 314 r3/win/sems-win.cpp \ … … 338 339 generic/uuid-generic.cpp \ 339 340 r3/linux/mp-linux.cpp \ 341 r3/linux/rtProcInitExePath-linux.cpp \ 340 342 r3/linux/sched-linux.cpp \ 341 343 r3/linux/time-linux.cpp \ … … 394 396 r3/os2/filelock-os2.cpp \ 395 397 r3/os2/mp-os2.cpp \ 398 r3/os2/rtProcInitExePath-os2.cpp \ 396 399 r3/os2/sched-os2.cpp \ 397 400 r3/os2/sems-os2.cpp \ … … 431 434 r3/darwin/filelock-darwin.cpp \ 432 435 r3/darwin/mp-darwin.cpp \ 436 r3/darwin/rtProcInitExePath-darwin.cpp \ 433 437 r3/darwin/time-darwin.cpp \ 434 438 r3/posix/RTSystemQueryOSInfo-posix.cpp \ … … 466 470 generic/RTMpGetMaxFrequency-generic.cpp \ 467 471 r3/freebsd/alloc-freebsd.cpp \ 472 r3/freebsd/rtProcInitExePath-freebsd.cpp \ 468 473 r3/posix/RTSystemQueryOSInfo-posix.cpp \ 469 474 r3/posix/dir-posix.cpp \ … … 523 528 r3/posix/utf8-posix.cpp \ 524 529 r3/solaris/alloc-solaris.cpp \ 525 r3/solaris/mp-solaris.cpp 530 r3/solaris/mp-solaris.cpp \ 531 r3/solaris/rtProcInitExePath-solaris.cpp 526 532 527 533 ## PORTME: Porters add their selection of platform specific files for Ring-3 here. … … 556 562 generic/uuid-generic.cpp \ 557 563 l4/l4-errno.cpp \ 564 l4/rtProcInitExePath-l4.cpp \ 558 565 l4/process-l4env.cpp \ 559 566 l4/sems-l4env.cpp \ -
trunk/src/VBox/Runtime/include/internal/path.h
r8245 r11836 36 36 37 37 __BEGIN_DECLS 38 extern char g_szrtProgramPath[RTPATH_MAX];39 38 40 39 #if defined(RT_OS_OS2) || defined(RT_OS_WINDOWS) -
trunk/src/VBox/Runtime/include/internal/process.h
r8245 r11836 33 33 34 34 #include <iprt/process.h> 35 #include <iprt/param.h> 35 36 36 37 __BEGIN_DECLS … … 38 39 extern RTPROCESS g_ProcessSelf; 39 40 extern RTPROCPRIORITY g_enmProcessPriority; 41 extern char g_szrtProcExePath[RTPATH_MAX]; 42 extern size_t g_cchrtProcExePath; 43 extern size_t g_cchrtProcDir; 44 extern size_t g_offrtProcName; 40 45 41 46 /** … … 50 55 int rtProcNativeSetPriority(RTPROCPRIORITY enmPriority); 51 56 57 /** 58 * Determins the full path to the executable image. 59 * 60 * This is called by rtR3Init. 61 * 62 * @returns IPRT status code. 63 * 64 * @param pszPath Pointer to the g_szrtProcExePath buffer. 65 * @param cchPath The size of the buffer. 66 */ 67 DECLHIDDEN(int) rtProcInitExePath(char *pszPath, size_t cchPath); 68 52 69 __END_DECLS 53 70 -
trunk/src/VBox/Runtime/r3/init.cpp
r11822 r11836 69 69 static bool volatile g_fInitializing = false; 70 70 71 /** Program path. 72 * The size is hardcoded, so we'll have to check for overflow when setting it 73 * since some hosts might support longer paths. 74 * @internal 75 */ 76 char g_szrtProgramPath[RTPATH_MAX]; 71 /** The process path. 72 * This is used by RTPathProgram and RTProcGetExecutableName and set by rtProcInitName. */ 73 char g_szrtProcExePath[RTPATH_MAX]; 74 /** The length of g_szrtProcExePath. */ 75 size_t g_cchrtProcExePath; 76 /** The length of directory path component of g_szrtProcExePath. */ 77 size_t g_cchrtProcDir; 78 /** The offset of the process name into g_szrtProcExePath. */ 79 size_t g_offrtProcName; 77 80 78 81 /** … … 100 103 */ 101 104 RTPROCPRIORITY g_enmProcessPriority = RTPROCPRIORITY_DEFAULT; 105 106 107 108 /** 109 * Internal worker which initializes or re-initializes the 110 * program path, name and directory globals. 111 * 112 * @returns IPRT status code. 113 * @param pszProgramPath The program path, NULL if not specified. 114 */ 115 static int rtR3InitProgramPath(const char *pszProgramPath) 116 { 117 /* 118 * We're reserving 32 bytes here for file names as what not. 119 */ 120 if (!pszProgramPath) 121 { 122 int rc = rtProcInitExePath(g_szrtProcExePath, sizeof(g_szrtProcExePath) - 32); 123 if (RT_FAILURE(rc)) 124 return rc; 125 } 126 else 127 { 128 size_t cch = strlen(pszProgramPath); 129 Assert(cch > 1); 130 AssertMsgReturn(cch < sizeof(g_szrtProcExePath) - 32, ("%zu\n", cch), VERR_BUFFER_OVERFLOW); 131 memcpy(g_szrtProcExePath, pszProgramPath, cch + 1); 132 } 133 134 /* 135 * Parse the name. 136 */ 137 ssize_t offName; 138 g_cchrtProcExePath = RTPathParse(g_szrtProcExePath, &g_cchrtProcDir, &offName, NULL); 139 g_offrtProcName = offName; 140 return VINF_SUCCESS; 141 } 102 142 103 143 … … 111 151 static int rtR3Init(bool fInitSUPLib, const char *pszProgramPath) 112 152 { 153 int rc = VINF_SUCCESS; 113 154 /* no entry log flow, because prefixes and thread may freak out. */ 114 155 … … 128 169 SUPR3Init(NULL); 129 170 #endif 171 if (pszProgramPath) 172 rc = rtR3InitProgramPath(pszProgramPath); 173 return rc; 130 174 } 131 175 ASMAtomicWriteBool(&g_fInitializing, true); … … 154 198 * without having initialized TLS entries and suchlike. 155 199 */ 156 intrc = rtThreadInit();200 rc = rtThreadInit(); 157 201 if (RT_FAILURE(rc)) 158 202 { 159 AssertMsgFailed(("Failed to get executable directory path, rc=%d!\n", rc));203 AssertMsgFailed(("Failed to initialize threads, rc=%Rrc!\n", rc)); 160 204 ASMAtomicWriteBool(&g_fInitializing, false); 161 205 ASMAtomicDecS32(&g_cUsers); … … 181 225 g_u64ProgramStartMilliTS = g_u64ProgramStartNanoTS / 1000000; 182 226 183 #if !defined(IN_GUEST) && !defined(RT_NO_GIP)184 /*185 * The threading is initialized we can safely sleep a bit if GIP186 * needs some time to update itself updating.187 */188 if (fInitSUPLib && g_pSUPGlobalInfoPage)189 {190 RTThreadSleep(20);191 RTTimeNanoTS();192 }193 #endif194 195 /*196 * Get the executable path.197 *198 * We're also checking the depth here since we'll be199 * appending filenames to the executable path. Currently200 * we assume 16 bytes are what we need.201 */202 char szPath[RTPATH_MAX - 16];203 rc = RTPathProgram(szPath, sizeof(szPath));204 if (RT_FAILURE(rc))205 {206 AssertMsgFailed(("Failed to get executable directory path, rc=%d!\n", rc));207 ASMAtomicWriteBool(&g_fInitializing, false);208 ASMAtomicDecS32(&g_cUsers);209 return rc;210 }211 212 227 /* 213 228 * The Process ID. … … 220 235 221 236 /* 222 * More stuff to come. 237 * The executable path, name and directory. 238 */ 239 rc = rtR3InitProgramPath(pszProgramPath); 240 if (RT_FAILURE(rc)) 241 { 242 AssertLogRelMsgFailed(("Failed to get executable directory path, rc=%Rrc!\n", rc)); 243 ASMAtomicWriteBool(&g_fInitializing, false); 244 ASMAtomicDecS32(&g_cUsers); 245 return rc; 246 } 247 248 #if !defined(IN_GUEST) && !defined(RT_NO_GIP) 249 /* 250 * The threading is initialized we can safely sleep a bit if GIP 251 * needs some time to update itself updating. 252 */ 253 if (fInitSUPLib && g_pSUPGlobalInfoPage) 254 { 255 RTThreadSleep(20); 256 RTTimeNanoTS(); 257 } 258 #endif 259 260 /* 261 * More stuff to come? 223 262 */ 224 263 -
trunk/src/VBox/Runtime/r3/path.cpp
r8245 r11836 44 44 #include "internal/fs.h" 45 45 #include "internal/path.h" 46 #include "internal/process.h" 46 47 47 48 … … 121 122 122 123 /** 123 * Finds the filename in a path. 124 * 125 * @returns Pointer to filename within pszPath. 126 * @returns NULL if no filename (i.e. empty string or ends with a slash). 124 * Parses a path. 125 * 126 * It figures the length of the directory component, the offset of 127 * the file name and the location of the suffix dot. 128 * 129 * @returns The path length. 130 * 127 131 * @param pszPath Path to find filename in. 128 */ 129 RTDECL(char *) RTPathFilename(const char *pszPath) 132 * @param pcbDir Where to put the length of the directory component. 133 * If no directory, this will be 0. Optional. 134 * @param poffName Where to store the filename offset. 135 * If empty string or if it's ending with a slash this 136 * will be set to -1. Optional. 137 * @param poffSuff Where to store the suffix offset (the last dot). 138 * If empty string or if it's ending with a slash this 139 * will be set to -1. Optional. 140 * @param pfFlags Where to set flags returning more information about 141 * the path. For the future. Optional. 142 */ 143 RTDECL(size_t) RTPathParse(const char *pszPath, size_t *pcchDir, ssize_t *poffName, ssize_t *poffSuff) 130 144 { 131 145 const char *psz = pszPath; 132 const char *pszLastComp = pszPath; 146 ssize_t offRoot = 0; 147 const char *pszName = pszPath; 148 const char *pszLastDot = NULL; 133 149 134 150 for (;; psz++) … … 139 155 #if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2) 140 156 case ':': 141 pszLastComp = psz + 1; 157 pszName = psz + 1; 158 cchRoot = pszName - psz; 142 159 break; 143 160 … … 145 162 #endif 146 163 case '/': 147 pszLastComp = psz + 1; 164 pszName = psz + 1; 165 break; 166 167 case '.': 168 pszLastDot = psz; 169 break; 170 171 /* 172 * The end. Complete the results. 173 */ 174 case '\0': 175 { 176 ssize_t offName = *pszName != '\0' ? pszName - pszPath : -1; 177 if (poffName) 178 *poffName = offName; 179 180 if (poffSuff) 181 { 182 ssize_t offSuff = -1; 183 if (pszLastDot) 184 { 185 offSuff = pszLastDot - pszPath; 186 if (offSuff <= offName) 187 offSuff = -1; 188 } 189 *poffSuff = offSuff; 190 } 191 192 if (pcchDir) 193 { 194 ssize_t off = offName - 1; 195 while (off >= offRoot && RTPATH_IS_SLASH(pszPath[off])) 196 off--; 197 *pcchDir = RT_MAX(off, offRoot) + 1; 198 } 199 200 return psz - pszPath; 201 } 202 } 203 } 204 205 /* will never get here */ 206 return 0; 207 } 208 209 210 /** 211 * Finds the filename in a path. 212 * 213 * @returns Pointer to filename within pszPath. 214 * @returns NULL if no filename (i.e. empty string or ends with a slash). 215 * @param pszPath Path to find filename in. 216 */ 217 RTDECL(char *) RTPathFilename(const char *pszPath) 218 { 219 const char *psz = pszPath; 220 const char *pszName = pszPath; 221 222 for (;; psz++) 223 { 224 switch (*psz) 225 { 226 /* handle separators. */ 227 #if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2) 228 case ':': 229 pszName = psz + 1; 230 break; 231 232 case '\\': 233 #endif 234 case '/': 235 pszName = psz + 1; 148 236 break; 149 237 150 238 /* the end */ 151 239 case '\0': 152 if (*psz LastComp)153 return (char *)(void *)psz LastComp;240 if (*pszName) 241 return (char *)(void *)pszName; 154 242 return NULL; 155 243 } … … 560 648 #ifndef RT_MINI 561 649 650 RTDECL(int) RTPathProgram(char *pszPath, unsigned cchPath) 651 { 652 AssertReturn(g_szrtProcExePath[0], VERR_WRONG_ORDER); 653 654 /* 655 * Calc the length and check if there is space before copying. 656 */ 657 size_t cch = g_cchrtProcDir; 658 if (cch <= cchPath) 659 { 660 memcpy(pszPath, g_szrtProcExePath, cch); 661 pszPath[cch] = '\0'; 662 return VINF_SUCCESS; 663 } 664 665 AssertMsgFailed(("Buffer too small (%zu <= %zu)\n", cchPath, cch)); 666 return VERR_BUFFER_OVERFLOW; 667 } 668 669 562 670 /** 563 671 * Gets the directory for architecture-independent application data, for -
trunk/src/VBox/Runtime/r3/posix/path-posix.cpp
r11468 r11836 43 43 #include <sys/types.h> 44 44 #include <pwd.h> 45 #ifdef RT_OS_DARWIN46 # include <mach-o/dyld.h>47 #endif48 45 49 46 #include <iprt/path.h> … … 53 50 #include <iprt/log.h> 54 51 #include "internal/path.h" 52 #include "internal/process.h" 55 53 #include "internal/fs.h" 56 54 … … 402 400 return rc; 403 401 } 404 405 406 #ifndef RT_MINI407 RTDECL(int) RTPathProgram(char *pszPath, unsigned cchPath)408 {409 /*410 * First time only.411 */412 if (!g_szrtProgramPath[0])413 {414 char* envPath = getenv("VBOX_PROGRAM_PATH");415 if (envPath)416 {417 strncpy(g_szrtProgramPath, envPath, sizeof(g_szrtProgramPath));418 } else {419 /*420 * Linux have no API for obtaining the executable path, but provides a symbolic link421 * in the proc file system. Note that readlink is one of the weirdest Unix apis around.422 *423 * OS/2 have an api for getting the program file name.424 */425 /** @todo use RTProcGetExecutableName() */426 #if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) || defined(RT_OS_SOLARIS)427 # ifdef RT_OS_LINUX428 int cchLink = readlink("/proc/self/exe", &g_szrtProgramPath[0], sizeof(g_szrtProgramPath) - 1);429 # elif defined(RT_OS_SOLARIS)430 char szFileBuf[PATH_MAX + 1];431 sprintf(szFileBuf, "/proc/%ld/path/a.out", (long)getpid());432 int cchLink = readlink(szFileBuf, &g_szrtProgramPath[0], sizeof(g_szrtProgramPath) - 1);433 # else /* RT_OS_FREEBSD: */434 int cchLink = readlink("/proc/curproc/file", &g_szrtProgramPath[0], sizeof(g_szrtProgramPath) - 1);435 # endif436 if (cchLink < 0 || cchLink == sizeof(g_szrtProgramPath) - 1)437 {438 int rc = RTErrConvertFromErrno(errno);439 AssertMsgFailed(("couldn't read /proc/self/exe. errno=%d cchLink=%d\n", errno, cchLink));440 LogFlow(("RTPathProgram(%p, %u): returns %Rrc\n", pszPath, cchPath, rc));441 return rc;442 }443 g_szrtProgramPath[cchLink] = '\0';444 445 #elif defined(RT_OS_OS2) || defined(RT_OS_L4)446 _execname(g_szrtProgramPath, sizeof(g_szrtProgramPath));447 448 #elif defined(RT_OS_DARWIN)449 const char *pszImageName = _dyld_get_image_name(0);450 AssertReturn(pszImageName, VERR_INTERNAL_ERROR);451 size_t cchImageName = strlen(pszImageName);452 if (cchImageName >= sizeof(g_szrtProgramPath))453 AssertReturn(pszImageName, VERR_INTERNAL_ERROR);454 memcpy(g_szrtProgramPath, pszImageName, cchImageName + 1);455 456 #else457 # error needs porting.458 #endif459 }460 /*461 * Convert to UTF-8 and strip of the filename.462 */463 char *pszTmp = NULL;464 int rc = rtPathFromNative(&pszTmp, &g_szrtProgramPath[0]);465 if (RT_FAILURE(rc))466 {467 LogFlow(("RTPathProgram(%p, %u): returns %Rrc\n", pszPath, cchPath, rc));468 return rc;469 }470 size_t cch = strlen(pszTmp);471 if (cch >= sizeof(g_szrtProgramPath))472 {473 RTStrFree(pszTmp);474 LogFlow(("RTPathProgram(%p, %u): returns %Rrc\n", pszPath, cchPath, VERR_BUFFER_OVERFLOW));475 return VERR_BUFFER_OVERFLOW;476 }477 memcpy(g_szrtProgramPath, pszTmp, cch + 1);478 RTPathStripFilename(g_szrtProgramPath);479 RTStrFree(pszTmp);480 }481 482 /*483 * Calc the length and check if there is space before copying.484 */485 unsigned cch = strlen(g_szrtProgramPath) + 1;486 if (cch <= cchPath)487 {488 memcpy(pszPath, g_szrtProgramPath, cch + 1);489 LogFlow(("RTPathProgram(%p:{%s}, %u): returns %Rrc\n", pszPath, pszPath, cchPath, VINF_SUCCESS));490 return VINF_SUCCESS;491 }492 493 AssertMsgFailed(("Buffer too small (%d < %d)\n", cchPath, cch));494 LogFlow(("RTPathProgram(%p, %u): returns %Rrc\n", pszPath, cchPath, VERR_BUFFER_OVERFLOW));495 return VERR_BUFFER_OVERFLOW;496 }497 #endif /* !RT_MINI */498 402 499 403 -
trunk/src/VBox/Runtime/r3/posix/process-posix.cpp
r11337 r11836 235 235 236 236 237 RTR3DECL(char *) RTProcGetExecutableName(char *pszExecName, size_t cchExecName)238 {239 /*240 * I don't think there is a posix API for this, but241 * because I'm lazy I'm not creating OS specific code242 * files and code for this.243 */244 #if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) || defined(RT_OS_SOLARIS)245 # ifdef RT_OS_LINUX246 int cchLink = readlink("/proc/self/exe", pszExecName, cchExecName - 1);247 # elif defined(RT_OS_SOLARIS)248 char szFileBuf[80];249 RTStrPrintf(szFileBuf, sizeof(szFileBuf), "/proc/%ld/path/a.out", (long)getpid());250 int cchLink = readlink(szFileBuf, pszExecName, cchExecName - 1);251 # else252 int cchLink = readlink("/proc/curproc/file", pszExecName, cchExecName - 1);253 # endif254 if (cchLink > 0 && (size_t)cchLink <= cchExecName - 1)255 {256 pszExecName[cchLink] = '\0';257 return pszExecName;258 }259 260 #elif defined(RT_OS_OS2) || defined(RT_OS_L4)261 if (!_execname(pszExecName, cchExecName))262 return pszExecName;263 264 #elif defined(RT_OS_DARWIN)265 const char *pszImageName = _dyld_get_image_name(0);266 if (pszImageName)267 {268 size_t cchImageName = strlen(pszImageName);269 if (cchImageName < cchExecName)270 return (char *)memcpy(pszExecName, pszImageName, cchImageName + 1);271 }272 273 #else274 # error "Port me!"275 #endif276 return NULL;277 }278 279 237 /** 280 238 * Daemonize the current process, making it a background process. The current -
trunk/src/VBox/Runtime/r3/process.cpp
r8245 r11836 37 37 #include <iprt/assert.h> 38 38 #include <iprt/err.h> 39 #include <iprt/string.h> 39 40 #include "internal/process.h" 40 41 #include "internal/thread.h" … … 94 95 } 95 96 97 98 RTR3DECL(char *) RTProcGetExecutableName(char *pszExecName, size_t cchExecName) 99 { 100 AssertReturn(g_szrtProcExePath[0] != '\0', NULL); 101 102 /* 103 * Calc the length and check if there is space before copying. 104 */ 105 size_t cch = g_cchrtProcExePath; 106 if (cch <= cchExecName) 107 { 108 memcpy(pszExecName, g_szrtProcExePath, cch); 109 pszExecName[cch] = '\0'; 110 return pszExecName; 111 } 112 113 AssertMsgFailed(("Buffer too small (%zu <= %zu)\n", cchExecName, cch)); 114 return NULL; 115 } 116 -
trunk/src/VBox/Runtime/r3/win/path-win.cpp
r10911 r11836 120 120 121 121 return rc; 122 }123 124 125 /**126 * Gets the program path.127 *128 * @returns iprt status code.129 * @param pszPath Buffer where to store the path.130 * @param cchPath Buffer size in bytes.131 */132 RTDECL(int) RTPathProgram(char *pszPath, unsigned cchPath)133 {134 /*135 * First time only.136 */137 if (!g_szrtProgramPath[0])138 {139 HMODULE hExe = GetModuleHandle(NULL);140 if (!GetModuleFileName(hExe, &g_szrtProgramPath[0], sizeof(g_szrtProgramPath)))141 {142 AssertMsgFailed(("Couldn't get exe module name. lasterr=%d\n", GetLastError()));143 return RTErrConvertFromWin32(GetLastError());144 }145 RTPathStripFilename(g_szrtProgramPath);146 }147 148 /*149 * Calc the length and check if there is space before copying.150 */151 unsigned cch = strlen(g_szrtProgramPath) + 1;152 if (cch <= cchPath)153 {154 memcpy(pszPath, g_szrtProgramPath, cch + 1);155 return VINF_SUCCESS;156 }157 158 AssertMsgFailed(("Buffer too small (%d < %d)\n", cchPath, cch));159 return VERR_BUFFER_OVERFLOW;160 122 } 161 123 -
trunk/src/VBox/Runtime/r3/win/process-win.cpp
r8245 r11836 244 244 } 245 245 246 247 RTR3DECL(char *) RTProcGetExecutableName(char *pszExecName, size_t cchExecName)248 {249 HMODULE hExe = GetModuleHandle(NULL);250 if (GetModuleFileName(hExe, pszExecName, cchExecName))251 return pszExecName;252 return NULL;253 }254 -
trunk/src/VBox/Runtime/testcase/tstPath.cpp
r8245 r11836 33 33 *******************************************************************************/ 34 34 #include <iprt/path.h> 35 #include <iprt/runtime.h> 35 #include <iprt/process.h> 36 #include <iprt/initterm.h> 36 37 #include <iprt/stream.h> 37 38 #include <iprt/err.h> … … 45 46 { \ 46 47 cErrors++; \ 47 RTPrintf("\ntstPath: FAILED calling " #method " at line %d: rc=% Vrc\n", __LINE__, rc); \48 RTPrintf("\ntstPath: FAILED calling " #method " at line %d: rc=%Rrc\n", __LINE__, rc); \ 48 49 } \ 49 50 } while (0) … … 61 62 62 63 /* 63 * RTPathProgram, RTPathUserHome 64 * RTPathProgram, RTPathUserHome and RTProcGetExecutableName. 64 65 */ 65 66 char szPath[RTPATH_MAX]; … … 70 71 if (RT_SUCCESS(rc)) 71 72 RTPrintf("UserHome={%s}\n", szPath); 73 if (RTProcGetExecutableName(szPath, sizeof(szPath)) == szPath) 74 RTPrintf("ExecutableName={%s}\n", szPath); 75 else 76 { 77 RTPrintf("tstPath: FAILED - RTProcGetExecutableName\n"); 78 cErrors++; 79 } 80 72 81 73 82 /*
Note:
See TracChangeset
for help on using the changeset viewer.