mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-02 00:44:12 +08:00
mdbx-tests: add osal_removefile().
Change-Id: Ifdacd1f799e3ed12f6b83bcdef0effbc0c41011c
This commit is contained in:
parent
2770e193b6
commit
12174187e8
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright 2017-2018 Leonid Yuriev <leo@yuriev.ru>
|
||||
* and other libmdbx authors: please see AUTHORS file.
|
||||
* All rights reserved.
|
||||
@ -301,3 +301,7 @@ std::string osal_tempdir(void) {
|
||||
return "/dev/shm/";
|
||||
return "";
|
||||
}
|
||||
|
||||
int osal_removefile(const std::string &pathname) {
|
||||
return unlink(pathname.c_str()) ? errno : MDBX_SUCCESS;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright 2017-2018 Leonid Yuriev <leo@yuriev.ru>
|
||||
* and other libmdbx authors: please see AUTHORS file.
|
||||
* All rights reserved.
|
||||
@ -405,3 +405,7 @@ std::string osal_tempdir(void) {
|
||||
DWORD len = GetTempPathA(sizeof(buf), buf);
|
||||
return std::string(buf, len);
|
||||
}
|
||||
|
||||
int osal_removefile(const std::string &pathname) {
|
||||
return DeleteFileA(pathname.c_str()) ? MDBX_SUCCESS : GetLastError();
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright 2017-2018 Leonid Yuriev <leo@yuriev.ru>
|
||||
* and other libmdbx authors: please see AUTHORS file.
|
||||
* All rights reserved.
|
||||
@ -32,6 +32,7 @@ void osal_udelay(unsigned us);
|
||||
void osal_yield(void);
|
||||
bool osal_istty(int fd);
|
||||
std::string osal_tempdir(void);
|
||||
int osal_removefile(const std::string &pathname);
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#ifndef STDIN_FILENO
|
||||
|
Loading…
x
Reference in New Issue
Block a user