diff options
| author | Enji Cooper <ngie@FreeBSD.org> | 2019-04-24 05:47:09 +0000 |
|---|---|---|
| committer | Enji Cooper <ngie@FreeBSD.org> | 2019-04-24 05:47:09 +0000 |
| commit | 56bf253633cbce3e2dcba0a590b720219b98f8f9 (patch) | |
| tree | 9caf65b17865c05620e60fc439c97b027518acbe /tests | |
| parent | 8b82def341087b6512496f05f3aa3ca0ebc9b5a8 (diff) | |
Notes
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/sys/opencrypto/cryptodev.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/sys/opencrypto/cryptodev.py b/tests/sys/opencrypto/cryptodev.py index b727078f6869..98e4601f20a3 100644 --- a/tests/sys/opencrypto/cryptodev.py +++ b/tests/sys/opencrypto/cryptodev.py @@ -122,10 +122,12 @@ CIOCFINDDEV = 3223610220 CIOCCRYPTAEAD = 3225445229 def _getdev(): - fd = os.open('/dev/crypto', os.O_RDWR) buf = array.array('I', [0]) - ioctl(fd, CRIOGET, buf, 1) - os.close(fd) + fd = os.open('/dev/crypto', os.O_RDWR) + try: + ioctl(fd, CRIOGET, buf, 1) + finally: + os.close(fd) return buf[0] |
