Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
void mmap_lock(void)
{
if (pthread_mutex_lock(&mmap_mutex)) {
void mmap_lock(void)
{
if (pthread_mutex_lock(&mmap_mutex)) {
void mmap_unlock(void)
{
if (pthread_mutex_unlock(&mmap_mutex)) {
void mmap_unlock(void)
{
if (pthread_mutex_unlock(&mmap_mutex)) {
flProtect, 0, offset + length, NULL);
if (mapping.map_handle == 0) {
if (!CloseHandle(mapping.file_handle)) {
flProtect, 0, offset + length, NULL);
if (mapping.map_handle == 0) {
if (!CloseHandle(mapping.file_handle)) {
}
_set_errno(EACCES);
return MAP_FAILED;
}
_set_errno(EACCES);
return MAP_FAILED;
if (mapping.start == 0) {
DWORD dwLastErr = GetLastError();
if (!CloseHandle(mapping.map_handle)) {
if (mapping.start == 0) {
DWORD dwLastErr = GetLastError();
if (!CloseHandle(mapping.map_handle)) {
}
if (!CloseHandle(mapping.file_handle)) {
}
if (!CloseHandle(mapping.file_handle)) {
}
if (dwLastErr == ERROR_MAPPED_ALIGNMENT) {
}
if (dwLastErr == ERROR_MAPPED_ALIGNMENT) {
mmap_unlock();
if (!CloseHandle(mapping.map_handle)) {
mmap_unlock();
if (!CloseHandle(mapping.map_handle)) {
}
if (!CloseHandle(mapping.file_handle)) {
}
if (!CloseHandle(mapping.file_handle)) {
/* Cleanup of handles should never fail */
if (!UnmapViewOfFile(mmap_infos[i].start)) {
/* Cleanup of handles should never fail */
if (!UnmapViewOfFile(mmap_infos[i].start)) {
}
if (!CloseHandle(mmap_infos[i].map_handle)) {
}
if (!CloseHandle(mmap_infos[i].map_handle)) {
}
if (!CloseHandle(mmap_infos[i].file_handle)) {
}
if (!CloseHandle(mmap_infos[i].file_handle)) {
#elif defined(__MINGW32__) /* #ifdef BABELTRACE_HAVE_POSIX_FALLOCATE */
#elif defined(__MINGW32__) /* #ifdef BABELTRACE_HAVE_POSIX_FALLOCATE */
#include <windows.h>
#include <fcntl.h>
#include <windows.h>
#include <fcntl.h>
/* Restore the original file pointer position */
if (!SetFilePointerEx(handle, file_pos, NULL, FILE_BEGIN)) {
/* We moved the file pointer but failed to restore it. */
/* Restore the original file pointer position */
if (!SetFilePointerEx(handle, file_pos, NULL, FILE_BEGIN)) {
/* We moved the file pointer but failed to restore it. */