Changes to deal with failed session creation by keeping the new session in existence until all related DCBs have closed; minor changes in response to reviews.

This commit is contained in:
Martin Brampton
2015-09-17 08:15:32 +01:00
parent 30239f395a
commit 0cba9b797f
3 changed files with 65 additions and 46 deletions

View File

@ -100,10 +100,9 @@ random_jkiss_devrand(void)
int fn;
unsigned int r;
if ((fn = open("/dev/urandom", O_RDONLY)) == -1) return 0;
if (read(fn, &r, 4) != 4)
if (read(fn, &r, sizeof(r)) != sizeof(r))
{
close(fn);
return 0;
r = 0;
}
close(fn);
return r;