From: Brad Smith Date: Thu, 1 Apr 2021 17:34:00 +0000 (-0400) Subject: oslib-posix: Remove OpenBSD workaround for fcntl("/dev/null", F_SETFL, O_NONBLOCK... X-Git-Tag: v6.1.0-rc0~84^2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=29c3d213f4ad69688638330728cff1a8769d7415;p=thirdparty%2Fqemu.git 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: Brad Smith Message-Id: Signed-off-by: Paolo Bonzini --- diff --git a/util/oslib-posix.c b/util/oslib-posix.c index 36820fec169..7b4bec1402e 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -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;