diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-06-27 21:08:05 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-06-27 21:09:38 +0100 |
commit | 9b3e5c211451ac07bd96cd997ac714bcbe1809b0 (patch) | |
tree | 6d58ed01fcc280e2bf06232f500a15aefef6f40a | |
parent | caf43fcadb0fcb3d342543f1e7dd78ee2314a627 (diff) |
intel: #ifdef O_CLOEXEC for compilation on squeeze
If the system doesn't support O_CLOEXEC, then we simply can't use it.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/intel_device.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/intel_device.c b/src/intel_device.c index 1880a9bb..e1e79a00 100644 --- a/src/intel_device.c +++ b/src/intel_device.c @@ -85,8 +85,15 @@ static int __intel_open_device(const struct pci_device *pci, const char *path) } fd = drmOpen(NULL, id); - } else - fd = open(path, O_RDWR | O_CLOEXEC); + } else { + fd = open(path, O_RDWR | +#ifdef O_CLOEXEC + O_CLOEXEC | +#endif + 0); + if (fd == -1) + fd = open(path, O_RDWR); + } return fd; } |