From 6aaf23ce31092f034124db32f80ad6fcbd4e6f19 Mon Sep 17 00:00:00 2001 From: Matt Chapman Date: Tue, 17 Oct 2000 06:12:31 +0000 Subject: [PATCH] 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 --- rdesktop.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rdesktop.c b/rdesktop.c index 61f0000..2257722 100644 --- a/rdesktop.c +++ b/rdesktop.c @@ -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;