aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/cpp/blaze.cc
diff options
context:
space:
mode:
authorGravatar Ulf Adams <ulfjack@google.com>2015-07-24 12:17:18 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2015-07-27 08:32:47 +0000
commit523bff51edca2e098f2c072325776c0dc6c6a727 (patch)
treee969ac1630e4bfa2c590fe09d9a9710574cfa3e7 /src/main/cpp/blaze.cc
parent5f66155b0d34ff7ad2754ae37be941b934dd18bc (diff)
Fix some C++ compiler warnings to comply with -Wall.
Some progress towards #311. -- Change-Id: I9276519d4a97d358b7c4f4e34a861522d75dd495 Reviewed-on: https://bazel-review.googlesource.com/#/c/1710 MOS_MIGRATED_REVID=99019961
Diffstat (limited to 'src/main/cpp/blaze.cc')
-rw-r--r--src/main/cpp/blaze.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/main/cpp/blaze.cc b/src/main/cpp/blaze.cc
index caa95b2bac..4c1b08d041 100644
--- a/src/main/cpp/blaze.cc
+++ b/src/main/cpp/blaze.cc
@@ -517,6 +517,7 @@ static int StartServer(int socket) {
Daemonize(socket);
ExecuteProgram(exe, jvm_args_vector);
pdie(blaze_exit_code::INTERNAL_ERROR, "execv of '%s' failed", exe.c_str());
+ return -1;
}
static bool KillRunningServerIfAny();
@@ -589,6 +590,7 @@ static int Connect(int socket, const string &socket_file) {
} else {
pdie(blaze_exit_code::LOCAL_ENVIRONMENTAL_ERROR,
"realpath('%s') failed", socket_file.c_str());
+ return -1;
}
}
@@ -635,12 +637,9 @@ static int ConnectToServer(bool start) {
if (Connect(s, socket_file) == 0) {
return s;
}
- if (!start) {
- return -1;
- } else {
- SetScheduling(
- globals->options.batch_cpu_scheduling,
- globals->options.io_nice_level);
+ if (start) {
+ SetScheduling(globals->options.batch_cpu_scheduling,
+ globals->options.io_nice_level);
int fd = StartServer(s);
if (fcntl(fd, F_SETFL, O_NONBLOCK | fcntl(fd, F_GETFL))) {
@@ -672,10 +671,11 @@ static int ConnectToServer(bool start) {
die(blaze_exit_code::INTERNAL_ERROR,
"\nError: couldn't connect to server at '%s' after 60 seconds.",
socket_file.c_str());
+ // The if never falls through here.
}
+ return -1;
}
-
// Kills the specified running Blaze server.
static void KillRunningServer(pid_t server_pid) {
fprintf(stderr, "Sending SIGTERM to previous %s server (pid=%d)... ",