summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2014-09-19 17:34:19 -0400
committerBenety Goh <benety@mongodb.com>2014-09-25 16:25:28 -0400
commit68881762f612542372f8f55d61db0bf7856da762 (patch)
tree21db55ee83493a13410fbdeeb502a8ade1023481
parent0adbbde35e8ca1696145f21bde5c311b3da6d4e5 (diff)
downloadmongo-68881762f612542372f8f55d61db0bf7856da762.tar.gz
SERVER-14835 removed PPC64-specific value for AlignedBuilder::Alignment. reject zero block size from ioctl()
-rw-r--r--src/mongo/util/alignedbuilder.h4
-rw-r--r--src/mongo/util/logfile.cpp3
2 files changed, 2 insertions, 5 deletions
diff --git a/src/mongo/util/alignedbuilder.h b/src/mongo/util/alignedbuilder.h
index 82824744a2a..460e737ba87 100644
--- a/src/mongo/util/alignedbuilder.h
+++ b/src/mongo/util/alignedbuilder.h
@@ -108,11 +108,7 @@ namespace mongo {
unsigned len() const { return _len; }
private:
-#ifndef __PPC64__
static const unsigned Alignment = 8192;
-#else
- static const unsigned Alignment = 65536;
-#endif
/** returns the pre-grow write position */
inline char* grow(unsigned by) {
diff --git a/src/mongo/util/logfile.cpp b/src/mongo/util/logfile.cpp
index e2498bfef78..e4caa418083 100644
--- a/src/mongo/util/logfile.cpp
+++ b/src/mongo/util/logfile.cpp
@@ -193,7 +193,8 @@ namespace mongo {
}
#ifdef __linux__
ssize_t tmpBlkSize = ioctl(_fd, BLKBSZGET);
- if (tmpBlkSize >= 0) {
+ // TODO: We need some sanity checking on tmpBlkSize even if ioctl() did not fail.
+ if (tmpBlkSize > 0) {
_blkSize = (size_t)tmpBlkSize;
}
#endif