qemu-common: Add definition for O_NONBLOCK
PATCH 1/1 qemu-common: Add definition for O_NONBLOCK
backends/rng-random.c which was added by commit5c74521d249486fa3e749dbbf6d56a70d4d7235f needs
macro O_NONBLOCK.
The macro O_NONBLOCK is not defined for all hosts. Adding a default definition fixes builds for MinGW.
---
This is a build fix. Therefore I'd appreciate if it could be committed soon.
Thanks
Stefan W.
qemu-common.h | 3 +++ 1 file changed, 3 insertions(+)
qemu-common.h +3 -0
@@ -55,6 +55,9 @@ typedef struct MigrationParams MigrationParams;#ifndef O_BINARY #define O_BINARY 0#endif +#ifndef O_NONBLOCK +#define O_NONBLOCK 0 +#endif #ifndef MAP_ANONYMOUS #define MAP_ANONYMOUS MAP_ANON#endif
Signature · 1 line
1.7.10.4
Il 17/11/2012 17:40, Stefan Weil ha scritto:
Quoted 4 lines
backends/rng-random.cwhich was added by commit5c74521d249486fa3e749dbbf6d56a70d4d7235fneeds
macroO_NONBLOCK.
Quoted 8 lines
The macro
O_NONBLOCKis not defined for all hosts. Adding a default definition fixes builds for MinGW.Signed-off-by Stefan Weil <[email protected]>---
This is a build fix. Therefore I'd appreciate if it could be committed soon.
This would make things blocking when they were supposed to be nonblocking, so I'd prefer not including it. I thought Anthony had a fix too?
Paolo
Am 18.11.2012 09:55, schrieb Paolo Bonzini:
Quoted 11 lines
Il 17/11/2012 17:40, Stefan Weil ha scritto:
Quoted 10 lines
backends/rng-random.cwhich was added by commit5c74521d249486fa3e749dbbf6d56a70d4d7235fneeds
macroO_NONBLOCK.The macro
O_NONBLOCKis not defined for all hosts. Adding a default definition fixes builds for MinGW.Signed-off-by Stefan Weil<[email protected]>---
Quoted 8 lines
Quoted 2 lines
This is a build fix. Therefore I'd appreciate if it could be committed soon.
This would make things blocking when they were supposed to be nonblocking, so I'd prefer not including it. I thought Anthony had a fix too?
Paolo
Yes, my patch is only a quick fix to enable builds with MinGW again.
Anthony's patch solves the same problem by omitting the code in comiplations for non-POSIX builds.
My primary goal was fixing the build, so any of these two patches is fine for me.
A backends/rng-random.c which compiles with MinGW would be even better, but maybe that needs a little more time. /dev/random is available with MinGW, so there is no basic problem doing this.
Stefan
Quoted 26 lines · Stefan Weil
Am 18.11.2012 09:55, schrieb Paolo Bonzini:
Quoted 11 lines
Il 17/11/2012 17:40, Stefan Weil ha scritto:
Quoted 10 lines
backends/rng-random.cwhich was added by commit5c74521d249486fa3e749dbbf6d56a70d4d7235fneeds
macroO_NONBLOCK.The macro
O_NONBLOCKis not defined for all hosts. Adding a default definition fixes builds for MinGW.Signed-off-by Stefan Weil<[email protected]>---
Quoted 8 lines
Quoted 2 lines
This is a build fix. Therefore I'd appreciate if it could be committed soon.
This would make things blocking when they were supposed to be nonblocking, so I'd prefer not including it. I thought Anthony had a fix too?
Paolo
Yes, my patch is only a quick fix to enable builds with MinGW again.
Anthony's patch solves the same problem by omitting the code in comiplations for non-POSIX builds.
Quoted 6 lines
My primary goal was fixing the build, so any of these two patches is fine for me.
A
backends/rng-random.cwhich compiles with MinGW would be even better, but maybe that needs a little more time./dev/randomis available with MinGW, so there is no basic problem doing this.
Anthony's rng POSIX build patch was merged, dropping this.
Stefan