1 /* Copyright (C) 2003 Red Hat, Inc.
3 * This software may be freely redistributed under the terms of the GNU
6 * You should have received a copy of the GNU General Public License
7 * along with this program; if not, write to the Free Software
8 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 if (stat ("/etc/hostid", &st) == 0 && S_ISREG (st.st_mode)
23 && st.st_size >= sizeof (n))
25 int fd = open ("/dev/random", O_RDONLY);
26 if (fd == -1 || read (fd, &n, sizeof (n)) != sizeof (n))
28 srand48 ((long int) time (NULL) ^ (long int) getpid ());