Changeset 3462
- Timestamp:
- Jun 17, 2007, 2:11:18 AM (18 years ago)
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/libc-0.6/src/emx/src/emxomf/emxomfld.c
r3417 r3462 634 634 char szLooklike[32]; 635 635 pid_t pid = getpid(); 636 const char * pszTmp = getenv("TMP"); 637 if (!pszTmp) pszTmp = getenv("TMPDIR"); 638 if (!pszTmp) pszTmp = getenv("TEMP"); 639 if (!pszTmp) pszTmp = "."; 636 static char s_szTmp[_MAX_PATH + 1]; 637 638 /* We need to apply _realrealpath to the tmpdir, so resolve that once and for all. */ 639 if (!s_szTmp[0]) 640 { 641 const char * pszTmp = getenv("TMP"); 642 if (!pszTmp) pszTmp = getenv("TMPDIR"); 643 if (!pszTmp) pszTmp = getenv("TEMP"); 644 if (!pszTmp) pszTmp = "."; 645 if (!_realrealpath(pszTmp, s_szTmp, sizeof(s_szTmp))) 646 { 647 printf("emxomfld: _realrealpath failed on '%s'!!!\n", pszTmp); 648 exit(1); 649 } 650 } 651 640 652 if (pszLooklike) 641 653 { … … 664 676 return -1; 665 677 gettimeofday(&tv, NULL); 666 sprintf(pszFile, "%s\\%s%s%x%lx%d%lx%s", pszTmp, pszPrefix, pszLooklike, pid, tv.tv_sec, c, tv.tv_usec, pszSuffix);678 sprintf(pszFile, "%s\\%s%s%x%lx%d%lx%s", s_szTmp, pszPrefix, pszLooklike, pid, tv.tv_sec, c, tv.tv_usec, pszSuffix); 667 679 } while (!stat(pszFile, &s)); 668 680 -
branches/libc-0.6/src/emx/src/emxomf/weakld.c
r2815 r3462 3611 3611 unsigned c = 0; 3612 3612 pid_t pid = getpid(); 3613 const char * pszTmp = getenv("TMP"); 3614 if (!pszTmp) pszTmp = getenv("TMPDIR"); 3615 if (!pszTmp) pszTmp = getenv("TEMP"); 3616 if (!pszTmp) pszTmp = "."; 3613 static char s_szTmp[_MAX_PATH + 1]; 3614 3615 /* We need to apply _realrealpath to the tmpdir, so resolve that once and for all. */ 3616 if (!s_szTmp[0]) 3617 { 3618 const char * pszTmp = getenv("TMP"); 3619 if (!pszTmp) pszTmp = getenv("TMPDIR"); 3620 if (!pszTmp) pszTmp = getenv("TEMP"); 3621 if (!pszTmp) pszTmp = "."; 3622 if (!_realrealpath(pszTmp, s_szTmp, sizeof(s_szTmp))) 3623 { 3624 printf("emxomfld: _realrealpath failed on '%s'!!!\n", pszTmp); 3625 exit(1); 3626 } 3627 } 3617 3628 3618 3629 do … … 3622 3633 return -1; 3623 3634 gettimeofday(&tv, NULL); 3624 sprintf(pszFile, "%s\\%s%x%lx%d%lx%s", pszTmp, pszPrefix, pid, tv.tv_sec, c, tv.tv_usec, pszSuffix);3635 sprintf(pszFile, "%s\\%s%x%lx%d%lx%s", s_szTmp, pszPrefix, pid, tv.tv_sec, c, tv.tv_usec, pszSuffix); 3625 3636 } while (!stat(pszFile, &s)); 3626 3637 -
trunk/emx/src/emxomf/emxomfld.c
r3417 r3462 634 634 char szLooklike[32]; 635 635 pid_t pid = getpid(); 636 const char * pszTmp = getenv("TMP"); 637 if (!pszTmp) pszTmp = getenv("TMPDIR"); 638 if (!pszTmp) pszTmp = getenv("TEMP"); 639 if (!pszTmp) pszTmp = "."; 636 static char s_szTmp[_MAX_PATH + 1]; 637 638 /* We need to apply _realrealpath to the tmpdir, so resolve that once and for all. */ 639 if (!s_szTmp[0]) 640 { 641 const char * pszTmp = getenv("TMP"); 642 if (!pszTmp) pszTmp = getenv("TMPDIR"); 643 if (!pszTmp) pszTmp = getenv("TEMP"); 644 if (!pszTmp) pszTmp = "."; 645 if (!_realrealpath(pszTmp, s_szTmp, sizeof(s_szTmp))) 646 { 647 printf("emxomfld: _realrealpath failed on '%s'!!!\n", pszTmp); 648 exit(1); 649 } 650 } 651 640 652 if (pszLooklike) 641 653 { … … 664 676 return -1; 665 677 gettimeofday(&tv, NULL); 666 sprintf(pszFile, "%s\\%s%s%x%lx%d%lx%s", pszTmp, pszPrefix, pszLooklike, pid, tv.tv_sec, c, tv.tv_usec, pszSuffix);678 sprintf(pszFile, "%s\\%s%s%x%lx%d%lx%s", s_szTmp, pszPrefix, pszLooklike, pid, tv.tv_sec, c, tv.tv_usec, pszSuffix); 667 679 } while (!stat(pszFile, &s)); 668 680 -
trunk/emx/src/emxomf/weakld.c
r2692 r3462 3611 3611 unsigned c = 0; 3612 3612 pid_t pid = getpid(); 3613 const char * pszTmp = getenv("TMP"); 3614 if (!pszTmp) pszTmp = getenv("TMPDIR"); 3615 if (!pszTmp) pszTmp = getenv("TEMP"); 3616 if (!pszTmp) pszTmp = "."; 3613 static char s_szTmp[_MAX_PATH + 1]; 3614 3615 /* We need to apply _realrealpath to the tmpdir, so resolve that once and for all. */ 3616 if (!s_szTmp[0]) 3617 { 3618 const char * pszTmp = getenv("TMP"); 3619 if (!pszTmp) pszTmp = getenv("TMPDIR"); 3620 if (!pszTmp) pszTmp = getenv("TEMP"); 3621 if (!pszTmp) pszTmp = "."; 3622 if (!_realrealpath(pszTmp, s_szTmp, sizeof(s_szTmp))) 3623 { 3624 printf("emxomfld: _realrealpath failed on '%s'!!!\n", pszTmp); 3625 exit(1); 3626 } 3627 } 3617 3628 3618 3629 do … … 3622 3633 return -1; 3623 3634 gettimeofday(&tv, NULL); 3624 sprintf(pszFile, "%s\\%s%x%lx%d%lx%s", pszTmp, pszPrefix, pid, tv.tv_sec, c, tv.tv_usec, pszSuffix);3635 sprintf(pszFile, "%s\\%s%x%lx%d%lx%s", s_szTmp, pszPrefix, pid, tv.tv_sec, c, tv.tv_usec, pszSuffix); 3625 3636 } while (!stat(pszFile, &s)); 3626 3637
Note:
See TracChangeset
for help on using the changeset viewer.