summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Chadima <jchadima@redhat.com>2010-08-05 18:35:51 +0200
committerMiloslav Trmač <mitr@redhat.com>2010-08-24 20:58:30 +0200
commit4553bbd1ed220d481955e8a7a503dcd89c1bef61 (patch)
tree805409a4e74766bb5c8534c091304134b2fb0df0
parent1b363a16597b791a7f8306c9d9ee2c8fadb34999 (diff)
downloadcryptodev-linux-4553bbd1ed220d481955e8a7a503dcd89c1bef61.tar.gz
cryptodev-linux-4553bbd1ed220d481955e8a7a503dcd89c1bef61.tar.xz
cryptodev-linux-4553bbd1ed220d481955e8a7a503dcd89c1bef61.zip
Use O_CLOEXEC for the internal file descriptor
-rw-r--r--userspace/ncrypto_fd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/userspace/ncrypto_fd.c b/userspace/ncrypto_fd.c
index a563694..ce925cf 100644
--- a/userspace/ncrypto_fd.c
+++ b/userspace/ncrypto_fd.c
@@ -17,7 +17,7 @@ ncr_global_init(unsigned int flags)
/* Open the crypto device unles is not already initialized */
pthread_mutex_lock(&open_lock);
- if ((__ncr_file_descriptor < 0) && ((__ncr_file_descriptor = open("/dev/crypto", O_RDWR)) < 0))
+ if ((__ncr_file_descriptor < 0) && ((__ncr_file_descriptor = open("/dev/crypto", O_RDWR|O_CLOEXEC)) < 0))
rv = -1;
else
++open_count;