Permalink
Browse files

Merge pull request #93 from agtorre/master

fixed some warnings and the make file for Kshitij/Hugh's changes
  • Loading branch information...
2 parents c564b63 + bbe26aa commit 40c32e9733c512d78717a22657880d67bb03fa5a Aaron Torres committed Sep 6, 2012
Showing with 14 additions and 16 deletions.
  1. +2 −4 src/Makefile.am
  2. +12 −12 src/XAttrs.cpp
View
@@ -47,8 +47,7 @@ lib_LTLIBRARIES = \
libplfs.la
include_HEADERS = \
-plfs.h \
-upc_map.h
+plfs.h
dist_pkginclude_HEADERS = \
COPYRIGHT.h \
@@ -96,8 +95,7 @@ plfs_private.cpp \
container_internals.cpp \
plfs.cpp \
mlog_oss.cpp \
-XAttrs.cpp \
-upc_map.cpp
+XAttrs.cpp
libplfs_la_SOURCES = \
$(headers) \
View
@@ -63,10 +63,10 @@ XAttr *XAttrs::getXAttr(string key, size_t len)
full_path = path + "/" + key;
fd = Util::Open( full_path.c_str(), O_RDONLY);
if (fd >= 0) {
- mlog(IDX_DAPI, "Opened key path: %s for key: %s", __FUNCTION__,
+ mlog(IDX_DAPI, "%s: Opened key path: %s for key: %s", __FUNCTION__,
full_path.c_str(), key.c_str());
} else {
- mlog(IDX_DRARE, "Could not open path: %s for key: %s", __FUNCTION__,
+ mlog(IDX_DRARE, "%s: Could not open path: %s for key: %s", __FUNCTION__,
full_path.c_str(), key.c_str());
return NULL;
}
@@ -78,7 +78,7 @@ XAttr *XAttrs::getXAttr(string key, size_t len)
}
if (ret < 0) {
- mlog(IDX_DRARE, "Could not read value for key: %s", __FUNCTION__,
+ mlog(IDX_DRARE, "%s: Could not read value for key: %s", __FUNCTION__,
key.c_str());
Util::Close(fd);
return NULL;
@@ -89,10 +89,10 @@ XAttr *XAttrs::getXAttr(string key, size_t len)
XAttr *xattr = new XAttr(key, (const char*)value);
ret = Util::Close(fd);
if (ret >= 0) {
- mlog(IDX_DAPI, "Closed file: %s", __FUNCTION__,
+ mlog(IDX_DAPI, "%s: Closed file: %s", __FUNCTION__,
full_path.c_str());
} else {
- mlog(IDX_DRARE, "Could not open path for key: %s", __FUNCTION__,
+ mlog(IDX_DRARE, "%s: Could not open path for key: %s", __FUNCTION__,
key.c_str());
return NULL;
}
@@ -113,42 +113,42 @@ bool XAttrs::setXAttr(string key, const char* value, size_t len)
string full_path;
if (key.length() > MAX_KEY_LEN) {
- mlog(IDX_DRARE, "key: %s is exceeds the maximum key length", __FUNCTION__,
+ mlog(IDX_DRARE, "%s: key: %s is exceeds the maximum key length", __FUNCTION__,
key.c_str());
return false;
}
if (len >= MAX_VALUE_LEN) {
- mlog(IDX_DRARE, "value: %s is exceeds the maximum value length", __FUNCTION__,
+ mlog(IDX_DRARE, "%s: value: %s is exceeds the maximum value length", __FUNCTION__,
value);
return false;
}
full_path = path + "/" + key;
fd = Util::Open( full_path.c_str(), O_WRONLY|O_CREAT|O_TRUNC, 0644);
if (fd >= 0) {
- mlog(IDX_DAPI, "Opened key path: %s for key: %s", __FUNCTION__,
+ mlog(IDX_DAPI, "%s: Opened key path: %s for key: %s", __FUNCTION__,
full_path.c_str(), key.c_str());
} else {
- mlog(IDX_DRARE, "Could not open path: %s for key: %s", __FUNCTION__,
+ mlog(IDX_DRARE, "%s: Could not open path: %s for key: %s", __FUNCTION__,
full_path.c_str(), key.c_str());
return false;
}
ret = Util::Write( fd, value, len);
if (ret < 0) {
- mlog(IDX_DRARE, "Could not write value for key: %s", __FUNCTION__,
+ mlog(IDX_DRARE, "%s: Could not write value for key: %s", __FUNCTION__,
key.c_str());
Util::Close(fd);
return false;
}
ret = Util::Close(fd);
if (ret >= 0) {
- mlog(IDX_DAPI, "Closed file: %s", __FUNCTION__,
+ mlog(IDX_DAPI, "%s: Closed file: %s", __FUNCTION__,
full_path.c_str());
} else {
- mlog(IDX_DRARE, "Could not open path for key: %s", __FUNCTION__,
+ mlog(IDX_DRARE, "%s: Could not open path for key: %s", __FUNCTION__,
key.c_str());
return false;
}

0 comments on commit 40c32e9

Please sign in to comment.