tools/libxendevicemodel: define O_CLOEXEC
PATCH 1/1 tools/libxendevicemodel: define O_CLOEXEC
Similar defines are already used elsewhere.
Fixes e7745d8ef5 ("tools/libxendevicemodel: introduce a Linux-specific implementation")
--- tools/libs/devicemodel/linux.c | 4 ++++ 1 file changed, 4 insertions(+)
tools/libs/devicemodel/linux.c +4 -0
@@ -31,6 +31,10 @@#include "private.h" +#ifndef O_CLOEXEC +#define O_CLOEXEC 0 +#endif +int osdep_xendevicemodel_open (xendevicemodel_handle *dmod) {int fd =open ("/dev/xen/privcmd" ,O_RDWR |O_CLOEXEC );
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 1 line · Olaf Hering
Similar defines are already used elsewhere.
I think I would like to change this a bit to be more explicit:
Some libc headers don't have O_CLOEXEC, we need to take care of it by defining to 0 (on the ground that such glibc might barf on O_CLOEXEC).
If you don't object, I will use the above paragraph.
Quoted 4 lines
Fixes
e7745d8ef5("tools/libxendevicemodel: introduce a Linux-specific implementation")Signed-off-by Olaf Hering <[email protected]>
Quoted 9 lines
--- tools/libs/devicemodel/linux.c | 4 ++++ 1 file changed, 4 insertions(+)tools/libs/devicemodel/linux.c +0
-0
tools/libs/devicemodel/linux.c line 40
Quoted 10 lines
tools/libs/devicemodel/linux.c +4
-0@@ -31,6 +31,10 @@#include "private.h" +#ifndef O_CLOEXEC +#define O_CLOEXEC 0 +#endif +int osdep_xendevicemodel_open (xendevicemodel_handle *dmod) {int fd =open ("/dev/xen/privcmd" ,O_RDWR |O_CLOEXEC );
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel