Skip to content
Snippets Groups Projects
Commit 29c3d213 authored by Brad Smith's avatar Brad Smith Committed by Paolo Bonzini
Browse files

oslib-posix: Remove OpenBSD workaround for fcntl("/dev/null", F_SETFL, O_NONBLOCK) failure


OpenBSD prior to 6.3 required a workaround to utilize fcntl(F_SETFL) on memory
devices.

Since modern verions of OpenBSD that are only officialy supported and buildable
on do not have this issue I am garbage collecting this workaround.

Signed-off-by: default avatarBrad Smith <brad@comstyle.com>

Message-Id: <YGYECGXQhdamEJgC@humpty.home.comstyle.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 7fa1c635
No related branches found
No related tags found
No related merge requests found
......@@ -273,17 +273,6 @@ int qemu_try_set_nonblock(int fd)
return -errno;
}
if (fcntl(fd, F_SETFL, f | O_NONBLOCK) == -1) {
#ifdef __OpenBSD__
/*
* Previous to OpenBSD 6.3, fcntl(F_SETFL) is not permitted on
* memory devices and sets errno to ENODEV.
* It's OK if we fail to set O_NONBLOCK on devices like /dev/null,
* because they will never block anyway.
*/
if (errno == ENODEV) {
return 0;
}
#endif
return -errno;
}
return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment