void mmap_lock(void)
{
if (pthread_mutex_lock(&mmap_mutex)) {
- assert(0);
+ abort();
}
}
void mmap_unlock(void)
{
if (pthread_mutex_unlock(&mmap_mutex)) {
- assert(0);
+ abort();
}
}
flProtect, 0, offset + length, NULL);
if (mapping.map_handle == 0) {
if (!CloseHandle(mapping.file_handle)) {
- assert(0);
+ abort();
}
_set_errno(EACCES);
return MAP_FAILED;
if (mapping.start == 0) {
DWORD dwLastErr = GetLastError();
if (!CloseHandle(mapping.map_handle)) {
- assert(0);
+ abort();
}
if (!CloseHandle(mapping.file_handle)) {
- assert(0);
+ abort();
}
if (dwLastErr == ERROR_MAPPED_ALIGNMENT) {
mmap_unlock();
if (!CloseHandle(mapping.map_handle)) {
- assert(0);
+ abort();
}
if (!CloseHandle(mapping.file_handle)) {
- assert(0);
+ abort();
}
_set_errno(ENOMEM);
/* Cleanup of handles should never fail */
if (!UnmapViewOfFile(mmap_infos[i].start)) {
- assert(0);
+ abort();
}
if (!CloseHandle(mmap_infos[i].map_handle)) {
- assert(0);
+ abort();
}
if (!CloseHandle(mmap_infos[i].file_handle)) {
- assert(0);
+ abort();
}
mmap_lock();
#elif defined(__MINGW32__) /* #ifdef BABELTRACE_HAVE_POSIX_FALLOCATE */
-#include <assert.h>
+#include <stdlib.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. */
- assert(0);
+ abort();
}
end: