[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

Patch for Tru64/OSF1



Here's a patch to fix a problem with times() on
Tru64/OSF1.  Apparently the times() function requires
the tms struct or it will seg. fault.

Joshua Weage

*** rdesktop-1.0.0/rdesktop.c   Mon Oct 16 04:44:47
2000
--- rdesktop-1.0.0.mod/rdesktop.c       Wed Nov 29
12:03:39 2000
***************
*** 187,192 ****
--- 187,193 ----
        struct stat st;
        uint32 *r = (uint32 *)random;
        int fd;
+       struct tms tms_struct;
  
        /* If we have a kernel random device, use it.
*/
        if ((fd = open("/dev/urandom", O_RDONLY)) !=
-1)
***************
*** 199,205 ****
        /* 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)
*/
        gettimeofday((struct timeval *)&r[3], NULL);
/* sec and usec */
        stat("/tmp", &st);
        r[5] = st.st_atime;
--- 200,206 ----
        /* Otherwise use whatever entropy we can
gather - ideas welcome. */
        r[0] = (getpid()) | (getppid() << 16);
        r[1] = (getuid()) | (getgid() << 16);
!       r[2] = times(&tms_struct); /* system uptime
(clocks) */        gettimeofday((struct timeval
*)&r[3], NULL); /* sec and usec */
        stat("/tmp", &st);
        r[5] = st.st_atime;



=====
Joshua Weage
--
--  <http://origin.me.gatech.edu/~weage>    --

__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/