* toplev.c (init_local_tick): Process the failure when read
fails for random_seed.
From-SVN: r220006
2015-01-23 Chen Gang <gang.chen.5i5j@gmail.com>
+ * toplev.c (init_local_tick): Process the failure when read
+ fails for random_seed.
+
* ubsan.c (ubsan_type_descriptor): Use 'pretty_print' for
'pretty_name' to avoid memory overflow.
int fd = open ("/dev/urandom", O_RDONLY);
if (fd >= 0)
{
- read (fd, &random_seed, sizeof (random_seed));
+ if (read (fd, &random_seed, sizeof (random_seed))
+ != sizeof (random_seed))
+ random_seed = 0;
close (fd);
}