|
From: | Stefan Weil |
Subject: | Re: [Qemu-devel] [PATCH] main: Hide F_GETFD and FD_CLOEXEC use for _WIN32 |
Date: | Mon, 22 Oct 2012 18:28:21 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20120922 Iceowl/1.0b1 Icedove/3.0.11 |
Am 22.10.2012 15:53, schrieb Corey Bryant:
Signed-off-by: Corey Bryant<address@hidden> --- vl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vl.c b/vl.c index 200d849..94c667d 100644 --- a/vl.c +++ b/vl.c @@ -812,11 +812,13 @@ static int parse_add_fd(QemuOpts *opts, void *opaque) return -1; } +#ifndef _WIN32 if (fcntl(fd, F_GETFD)& FD_CLOEXEC) { qerror_report(ERROR_CLASS_GENERIC_ERROR, "fd is not valid or already in use"); return -1; } +#endif if (fdset_id< 0) { qerror_report(ERROR_CLASS_GENERIC_ERROR,
Are you sure that all other hosts provide F_GETFD and FD_CLOEXEC and that MinGW will never do that? Maybe testing those two macros instead of _WIN32 would be better: #if defined(F_GETFD) && defined(FD_CLOEXEC) ... #endif I also think that this patch should be merged with the one which adds that code and not applied as a separate patch (otherwise git bisect would be broken). Regards Stefan Weil
[Prev in Thread] | Current Thread | [Next in Thread] |