OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: Mike Bennett (mbennettns1.cfcc.cc.fl.us)
Date: Tue Mar 06 2001 - 16:47:07 CST

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    Is the following change safe to make? Will it have any bad effect on Postfix
    operation? This is the only way I was able to get the 20010228 version to
    compile on an old Solaris 2.4 box.

    I'm simply replacing srandom() with srand() and
    random() with rand().

    *** rand_sleep.c.orig Sat Feb 3 19:00:22 2001
    --- rand_sleep.c Tue Mar 6 17:27:18 2001
    ***************
    *** 67,74 ****
           * Use the semi-crappy random number generator.
           */
          if (my_pid == 0)
    ! srandom((my_pid = getpid()) ^ time((time_t *) 0));
    ! usec = (delay - variation / 2) + variation * (double) random() / RAND_MAX;
          doze(usec);
      }

    --- 67,74 ----
           * Use the semi-crappy random number generator.
           */
          if (my_pid == 0)
    ! srand((my_pid = getpid()) ^ time((time_t *) 0));
    ! usec = (delay - variation / 2) + variation * (double) rand() / RAND_MAX;
          doze(usec);
      }