index 3ec7e136592de064ab7b671fc2c7df107d01e234..b57016a99cfd2aa4ec83f2d220b4248e1885af9d 100644 (file)
Int32 status = GateHWSpinlock_S_SUCCESS;
UInt32 dst;
Int32 fdMem;
+ int flags;
fdMem = open ("/dev/mem", O_RDWR | O_SYNC);
status = GateHWSpinlock_E_OSFAILURE;
}
+ /* make sure /dev/mem fd doesn't exist for 'fork() -> exec*()'ed child */
+ flags = fcntl(fdMem, F_GETFD);
+ if (flags != -1) {
+ fcntl(fdMem, F_SETFD, flags | FD_CLOEXEC);
+ }
+
/* map the hardware lock registers into the local address space */
if (status == GateHWSpinlock_S_SUCCESS) {
dst = (UInt32)mmap(NULL, _GateHWSpinlock_cfgParams.size,