mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-10-14 03:20:22 +00:00
[common] numerious bad usage bug fixes
This commit is contained in:
@@ -17,4 +17,7 @@ if(ENABLE_BACKTRACE)
|
||||
target_link_libraries(lg_common_platform_code bfd)
|
||||
endif()
|
||||
|
||||
target_link_libraries(lg_common_platform_code pthread)
|
||||
target_link_libraries(lg_common_platform_code
|
||||
lg_common
|
||||
pthread
|
||||
)
|
||||
|
@@ -42,7 +42,6 @@ static int uioOpenFile(const char * shmDevice, const char * file)
|
||||
{
|
||||
char * path;
|
||||
alloc_sprintf(&path, "/sys/class/uio/%s/%s", shmDevice, file);
|
||||
|
||||
int fd = open(path, O_RDONLY);
|
||||
if (fd < 0)
|
||||
{
|
||||
@@ -161,10 +160,14 @@ void ivshmemOptionsInit()
|
||||
}
|
||||
|
||||
bool ivshmemOpen(struct IVSHMEM * dev)
|
||||
{
|
||||
return ivshmemOpenDev(dev, option_get_string("app", "shmFile"));
|
||||
}
|
||||
|
||||
bool ivshmemOpenDev(struct IVSHMEM * dev, const char * shmDevice)
|
||||
{
|
||||
assert(dev);
|
||||
|
||||
const char * shmDevice = option_get_string("app", "shmFile");
|
||||
unsigned int devSize;
|
||||
int devFD;
|
||||
|
||||
@@ -257,5 +260,7 @@ void ivshmemClose(struct IVSHMEM * dev)
|
||||
close(info->fd);
|
||||
|
||||
free(info);
|
||||
dev->mem = NULL;
|
||||
dev->size = 0;
|
||||
dev->opaque = NULL;
|
||||
}
|
@@ -15,5 +15,6 @@ add_library(lg_common_platform_code STATIC
|
||||
)
|
||||
|
||||
target_link_libraries(lg_common_platform_code
|
||||
lg_common
|
||||
setupapi
|
||||
)
|
||||
|
Reference in New Issue
Block a user