From: Ken Raeburn Date: Sat, 3 Mar 2001 22:05:29 +0000 (+0000) Subject: only call ioctl on /dev/random if open succeeded X-Git-Tag: krb5-1.3-alpha1~1647 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=789117bd6e52853fc4a158b615356199888a8f93;p=krb5.git only call ioctl on /dev/random if open succeeded git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13051 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/os/init_os_ctx.c b/src/lib/krb5/os/init_os_ctx.c index f72d643f1..076c16ae4 100644 --- a/src/lib/krb5/os/init_os_ctx.c +++ b/src/lib/krb5/os/init_os_ctx.c @@ -466,7 +466,9 @@ krb5_os_init_context(ctx) if (tmp == -1) { int dontblock = 1; tmp = open ("/dev/random", O_RDONLY); - (void) ioctl (tmp, FIONBIO, (char *) &dontblock); + if (tmp != -1) + (void) ioctl (tmp, FIONBIO, + (char *) &dontblock); } if (tmp != -1) { /* If this doesn't work, should we continue or