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>
This commit is contained in:
Chris Wilson 2013-06-27 21:08:05 +01:00
parent caf43fcadb
commit 9b3e5c2114
1 changed files with 9 additions and 2 deletions

View File

@ -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;
}