Skip to content

error in MMapFile::error(int error) #6

Open
moknomo opened this Issue Oct 24, 2012 · 0 comments

1 participant

@moknomo
moknomo commented Oct 24, 2012

https://github.com/golubtsov/Fastcgi-Daemon/blob/master/request-cache/mmap_file.cpp#L97
std::string
MMapFile::error(int error) {
char buffer[256];
std::string result(strerror_r(error, buffer, sizeof(buffer)));
return result;
}

int strerror_r(int errnum, char *strerrbuf, size_t buflen);
strerror_r возвращает int, а заполняет strerrbuf
поэтому правильно будет так?

std::string
MMapFile::error(int error) {
char buffer[256];
strerror_r(error, buffer, sizeof(buffer));
std::string result(buffer);
return result;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.