mirror of
https://github.com/MariaDB/server.git
synced 2026-05-17 20:37:12 +02:00
Update Mroonga to the latest version on 2015-02-17T13:34:27+0900
This commit is contained in:
parent
162446a621
commit
f5dabd7aca
416 changed files with 46277 additions and 7137 deletions
|
|
@ -2,8 +2,7 @@ DEFS += -D_REENTRANT $(GRN_DEFS) -DGRN_DAT_EXPORT
|
|||
|
||||
DEFAULT_INCLUDES = \
|
||||
-I$(top_builddir) \
|
||||
-I$(top_srcdir)/include \
|
||||
-I$(top_srcdir)/lib
|
||||
-I$(top_srcdir)/include
|
||||
|
||||
noinst_LTLIBRARIES = libgrndat.la
|
||||
|
||||
|
|
|
|||
12
storage/mroonga/vendor/groonga/lib/dat/dat.hpp
vendored
12
storage/mroonga/vendor/groonga/lib/dat/dat.hpp
vendored
|
|
@ -175,13 +175,6 @@ class Exception : public std::exception {
|
|||
what_(ex.what_) {}
|
||||
virtual ~Exception() throw() {}
|
||||
|
||||
virtual Exception &operator=(const Exception &ex) throw() {
|
||||
file_ = ex.file_;
|
||||
line_ = ex.line_;
|
||||
what_ = ex.what_;
|
||||
return *this;
|
||||
}
|
||||
|
||||
virtual ErrorCode code() const throw() = 0;
|
||||
virtual const char *file() const throw() {
|
||||
return file_;
|
||||
|
|
@ -210,11 +203,6 @@ class Error : public Exception {
|
|||
: Exception(ex) {}
|
||||
virtual ~Error() throw() {}
|
||||
|
||||
virtual Error &operator=(const Error &ex) throw() {
|
||||
*static_cast<Exception *>(this) = ex;
|
||||
return *this;
|
||||
}
|
||||
|
||||
virtual ErrorCode code() const throw() {
|
||||
return T;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,12 @@
|
|||
#include <algorithm>
|
||||
#include <limits>
|
||||
|
||||
#ifdef WIN32
|
||||
# define GRN_IO_FILE_CREATE_MODE (GENERIC_READ | GENERIC_WRITE)
|
||||
#else /* WIN32 */
|
||||
# define GRN_IO_FILE_CREATE_MODE 0644
|
||||
#endif /* WIN32 */
|
||||
|
||||
namespace grn {
|
||||
namespace dat {
|
||||
|
||||
|
|
@ -119,7 +125,7 @@ void FileImpl::swap(FileImpl *rhs) {
|
|||
|
||||
void FileImpl::create_(const char *path, UInt64 size) {
|
||||
if ((path != NULL) && (path[0] != '\0')) {
|
||||
file_ = ::CreateFileA(path, GENERIC_READ | GENERIC_WRITE,
|
||||
file_ = ::CreateFileA(path, GRN_IO_FILE_CREATE_MODE,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||
NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
GRN_DAT_THROW_IF(IO_ERROR, file_ == INVALID_HANDLE_VALUE);
|
||||
|
|
@ -162,7 +168,7 @@ void FileImpl::open_(const char *path) {
|
|||
GRN_DAT_THROW_IF(IO_ERROR,
|
||||
static_cast<UInt64>(st.st_size) > std::numeric_limits< ::size_t>::max());
|
||||
|
||||
file_ = ::CreateFileA(path, GENERIC_READ | GENERIC_WRITE,
|
||||
file_ = ::CreateFileA(path, GRN_IO_FILE_CREATE_MODE,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
GRN_DAT_THROW_IF(IO_ERROR, file_ == NULL);
|
||||
|
|
@ -192,7 +198,7 @@ void FileImpl::create_(const char *path, UInt64 size) {
|
|||
size > static_cast<UInt64>(std::numeric_limits< ::off_t>::max()));
|
||||
|
||||
if ((path != NULL) && (path[0] != '\0')) {
|
||||
fd_ = ::open(path, O_RDWR | O_CREAT | O_TRUNC, 0666);
|
||||
fd_ = ::open(path, O_RDWR | O_CREAT | O_TRUNC, GRN_IO_FILE_CREATE_MODE);
|
||||
GRN_DAT_THROW_IF(IO_ERROR, fd_ == -1);
|
||||
|
||||
const ::off_t file_size = static_cast< ::off_t>(size);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue