Skip to content

Commit

Permalink
Cleanup & format
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterTea committed Oct 9, 2018
1 parent 4084659 commit 784733b
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 9 deletions.
20 changes: 19 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,25 @@
"stack": "cpp",
"future": "cpp",
"cfenv": "cpp",
"variant": "cpp"
"variant": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"codecvt": "cpp",
"condition_variable": "cpp",
"csignal": "cpp",
"cstdarg": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"iomanip": "cpp",
"iostream": "cpp",
"mutex": "cpp",
"numeric": "cpp",
"streambuf": "cpp",
"cinttypes": "cpp"
},
"C_Cpp.clang_format_style": "Google",
"C_Cpp.configurationWarnings": "Disabled"
Expand Down
2 changes: 1 addition & 1 deletion src/base/BackedWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ BackedWriterWriteState BackedWriter::write(const string& buf) {
if (bytesWritten == count) {
return BackedWriterWriteState::SUCCESS;
}
} else if(errno == EAGAIN) {
} else if (errno == EAGAIN) {
// Keep trying after 10ms
::usleep(10 * 1000);
} else {
Expand Down
8 changes: 4 additions & 4 deletions src/base/Connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ bool Connection::read(string* buf) {
if (messagesRead == -1) {
if (isSkippableError(errno)) {
// Close the socket and invalidate, then return 0 messages
LOG(INFO) << "Closing socket because " << errno << " "
<< strerror(errno);
LOG(INFO) << "Closing socket because " << errno << " " << strerror(errno);
closeSocket();
return 0;
} else {
// Throw the error
LOG(ERROR) << "Got a serious error trying to read: " << errno << " / " << strerror(errno);
LOG(ERROR) << "Got a serious error trying to read: " << errno << " / "
<< strerror(errno);
throw std::runtime_error("Failed a call to read");
}
} else {
return messagesRead>0;
return messagesRead > 0;
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/base/PipeSocketHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ int PipeSocketHandler::connect(const SocketEndpoint& endpoint) {
opts &= (~O_NONBLOCK);
FATAL_FAIL(fcntl(sockFd, F_SETFL, opts));
}
// Initialize the socket again once it's blocking to make sure timeouts are set
// Initialize the socket again once it's blocking to make sure timeouts
// are set
initSocket(sockFd);

// if we get here, we must have connected successfully
Expand Down
2 changes: 1 addition & 1 deletion src/htm/TerminalHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ string TerminalHandler::pollUserTerminal() {
return string();
}
}
} catch (std::exception ex) {
} catch (const std::exception& ex) {
LOG(INFO) << ex.what();
run = false;
#ifdef WITH_UTEMPTER
Expand Down
2 changes: 1 addition & 1 deletion src/terminal/UserTerminalHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ void UserTerminalHandler::runUserTerminal(int masterFd, pid_t childPid) {
}
}
}
} catch (std::exception ex) {
} catch (const std::exception &ex) {
LOG(INFO) << ex.what();
run = false;
break;
Expand Down

0 comments on commit 784733b

Please sign in to comment.