key_value_store: fixup errno handling

Don't use "errno" as a variable name, and include <errno.h>
instead of some of the specific paths.

Signed-off-by: Greg Farnum <greg@inktank.com>
This commit is contained in:
Greg Farnum 2013-07-01 14:57:39 -07:00 committed by Yehuda Sadeh
parent fc7d6227d3
commit b6c836657d
3 changed files with 4 additions and 5 deletions

View File

@ -6,8 +6,7 @@
*/
#include "objclass/objclass.h"
#include "/usr/include/asm-generic/errno-base.h"
#include "/usr/include/asm-generic/errno.h"
#include <errno.h>
#include "key_value_store/kvs_arg_types.h"
#include "include/types.h"
#include <iostream>

View File

@ -990,7 +990,7 @@ int KvFlatBtreeAsync::perform_ops(const string &debug_prefix,
return err;
}
int KvFlatBtreeAsync::cleanup(const index_data &idata, const int &errno) {
int KvFlatBtreeAsync::cleanup(const index_data &idata, const int &error) {
if (verbose) cout << "\t\t" << client_name << ": cleaning up after "
<< idata.str()
<< std::endl;
@ -998,7 +998,7 @@ int KvFlatBtreeAsync::cleanup(const index_data &idata, const int &errno) {
assert(idata.prefix != "");
map<std::string,bufferlist> new_index;
map<std::string, pair<bufferlist, int> > assertions;
switch (errno) {
switch (error) {
case -EFIRSTOBJ: {
//this happens if the split or rebalance failed to mark the first object,
//meaning only the index needs to be changed.

View File

@ -693,7 +693,7 @@ protected:
* died (should be -ENOENT or -ETIMEDOUT)
* @post: rolls forward if -ENOENT, otherwise rolls back.
*/
int cleanup(const index_data &idata, const int &errno);
int cleanup(const index_data &idata, const int &error);
/**
* does the ObjectWriteOperation and splits, reads the index, and/or retries