Browse files

port r53070 from trunk

git-svn-id: https://svn.r-project.org/R/branches/R-2-11-branch@53072 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information...
1 parent 446d7a3 commit 82246e6e6bb732eab06773a46772ec78738b66ea ripley committed Sep 30, 2010
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/gnuwin32/system.c
View
5 src/gnuwin32/system.c
@@ -818,7 +818,6 @@ void R_setupHistory(void)
}
#include <sys/stat.h>
-#include <time.h>
static int isDir(char *path)
{
struct stat sb;
@@ -1090,8 +1089,8 @@ int cmdlineoptions(int ac, char **av)
tm = getenv("R_USER"); /* this one will succeed */
}
}
- srand( (unsigned) time(NULL) );
- sprintf(ifile, "%s/Rscript%x%x", tm, rand(), rand());
+ /* in case getpid() is not unique -- has been seen under Windows */
+ sprintf(ifile, "%s/Rscript%x%x", tm, getpid(), (unsigned int) GetTickCount());
ifp = fopen(ifile, "w+b");
if(!ifp) R_Suicide(_("creation of tmpfile failed -- set TMPDIR suitably?"));
}

0 comments on commit 82246e6

Please sign in to comment.