Skip to content

Commit

Permalink
/dev/crypto: Suppress warning when open /dev/crypto fails with ENXIO.
Browse files Browse the repository at this point in the history
On NetBSD the device node is essentially always present, but these
days it's mostly not useful except for testing the kernel crypto
stack since the cost of CPU crypto has gone down much faster than the
cost of I/O to external crypto engines.  So on most systems it is
disabled in a way that makes open fail with ENXIO.  NetBSD has had
this warning for ENXIO patched away for years.
  • Loading branch information
Taylor R Campbell committed Mar 29, 2023
1 parent 30ab774 commit 455e352
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion engines/e_devcrypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -1228,7 +1228,7 @@ static int open_devcrypto(void)

if ((fd = open("/dev/crypto", O_RDWR, 0)) < 0) {
#ifndef ENGINE_DEVCRYPTO_DEBUG
if (errno != ENOENT)
if (errno != ENOENT && errno != ENXIO)
#endif
fprintf(stderr, "Could not open /dev/crypto: %s\n", strerror(errno));
return 0;
Expand Down

0 comments on commit 455e352

Please sign in to comment.