Commit 075eef9a authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[1704] style matters: don't omit {}, func name convention, typo.

also use unnamed namespace instead of file-scope static.  technically, this
use of static was deprecated in C++.  also use the unnamed namespace for
the entire TESTs, which is our common (though not explicitly documented)
convention.
parent 2e95197a
......@@ -113,8 +113,9 @@ void
LoggerImpl::setInterprocessSync(isc::util::InterprocessSync* sync) {
// If we are passed NULL, change nothing. The old sync_ object will
// continue to be used.
if (sync == NULL)
if (sync == NULL) {
return;
}
delete sync_;
sync_ = sync;
......
......@@ -47,9 +47,9 @@ class InterprocessSync {
public:
/// \brief Constructor
///
/// Creates a interprocess synchronization object
/// Creates an interprocess synchronization object
///
/// \param name Name of the synchronization task. This has to be
/// \param task_name Name of the synchronization task. This has to be
/// identical among the various processes that need to be
/// synchronized for the same task.
InterprocessSync(const std::string& task_name) :
......
......@@ -20,8 +20,9 @@ using namespace std;
namespace isc {
namespace util {
static unsigned char
parent_read_locked_state (int fd) {
namespace {
unsigned char
parentReadLockedState (int fd) {
unsigned char locked = 0xff;
fd_set rfds;
......@@ -46,7 +47,7 @@ parent_read_locked_state (int fd) {
read(fd, &locked, sizeof(locked));
}
return locked;
return (locked);
}
TEST(InterprocessSyncFileTest, TestLock) {
......@@ -85,7 +86,7 @@ TEST(InterprocessSyncFileTest, TestLock) {
// Parent reads from pipe
close(fds[1]);
const unsigned char locked = parent_read_locked_state(fds[0]);
const unsigned char locked = parentReadLockedState(fds[0]);
close(fds[0]);
......@@ -138,7 +139,7 @@ TEST(InterprocessSyncFileTest, TestMultipleFilesForked) {
// Parent reads from pipe
close(fds[1]);
const unsigned char locked = parent_read_locked_state(fds[0]);
const unsigned char locked = parentReadLockedState(fds[0]);
close(fds[0]);
......@@ -147,6 +148,7 @@ TEST(InterprocessSyncFileTest, TestMultipleFilesForked) {
EXPECT_TRUE(locker.unlock());
}
}
} // namespace util
} // namespace isc
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment