mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 15:53:45 +08:00
fix: add FileDescriptor class to ensure file descriptor is closed
Related-To: NEO-9038 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
c2d69e5857
commit
099a3f30e3
@@ -32,6 +32,7 @@ namespace NEO {
|
||||
namespace SysCalls {
|
||||
uint32_t closeFuncCalled = 0u;
|
||||
uint32_t openFuncCalled = 0u;
|
||||
int openFuncRetVal = 0;
|
||||
int closeFuncArgPassed = 0;
|
||||
int closeFuncRetVal = 0;
|
||||
int dlOpenFlags = 0;
|
||||
@@ -145,7 +146,7 @@ int open(const char *file, int flags) {
|
||||
return fakeFileDescriptor;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return openFuncRetVal;
|
||||
}
|
||||
|
||||
int openWithMode(const char *file, int flags, int mode) {
|
||||
|
||||
@@ -48,6 +48,8 @@ extern int (*sysCallsClosedir)(DIR *dir);
|
||||
extern int (*sysCallsGetDevicePath)(int deviceFd, char *buf, size_t &bufSize);
|
||||
|
||||
extern int flockRetVal;
|
||||
extern int openFuncRetVal;
|
||||
extern uint32_t openFuncCalled;
|
||||
extern int closeFuncRetVal;
|
||||
extern int closeFuncArgPassed;
|
||||
extern const char *drmVersion;
|
||||
|
||||
Reference in New Issue
Block a user