From 789117bd6e52853fc4a158b615356199888a8f93 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Sat, 3 Mar 2001 22:05:29 +0000 Subject: [PATCH] only call ioctl on /dev/random if open succeeded git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13051 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/os/init_os_ctx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- 2.26.2