times(NULL) results in a segmentation fault on OSF1.

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@21 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Matt Chapman 2000-10-17 06:12:31 +00:00
parent 6585bc027f
commit 6aaf23ce31

View File

@ -185,6 +185,7 @@ int main(int argc, char *argv[])
void generate_random(uint8 *random)
{
struct stat st;
struct tms tmsbuf;
uint32 *r = (uint32 *)random;
int fd;
@ -199,7 +200,7 @@ void generate_random(uint8 *random)
/* Otherwise use whatever entropy we can gather - ideas welcome. */
r[0] = (getpid()) | (getppid() << 16);
r[1] = (getuid()) | (getgid() << 16);
r[2] = times(NULL); /* system uptime (clocks) */
r[2] = times(&tmsbuf); /* system uptime (clocks) */
gettimeofday((struct timeval *)&r[3], NULL); /* sec and usec */
stat("/tmp", &st);
r[5] = st.st_atime;