aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/cpp/blaze.cc
diff options
context:
space:
mode:
authorGravatar Laszlo Csomor <laszlocsomor@google.com>2016-11-17 11:00:49 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2016-11-17 18:18:30 +0000
commit6c16765a010fccec9e3647e07d0c4b624e25445a (patch)
treeb43799ad3cb60ae3a5ee02462e446799f0749c5e /src/main/cpp/blaze.cc
parent8a48f616bc1e6df70a30c416268f2c1323ffa9b0 (diff)
Bazel client: no longer needs <utime.h>
Also remove a lot of unused header files. The only remaining header file not available on Windows is <unistd.h>, but cutting that dependency will be more complicated because we use read/write and similar I/O functions from it. -- MOS_MIGRATED_REVID=139439791
Diffstat (limited to 'src/main/cpp/blaze.cc')
-rw-r--r--src/main/cpp/blaze.cc15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/main/cpp/blaze.cc b/src/main/cpp/blaze.cc
index 39d1165c5e..53e38765a9 100644
--- a/src/main/cpp/blaze.cc
+++ b/src/main/cpp/blaze.cc
@@ -30,21 +30,13 @@
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
-#include <sched.h>
-#include <signal.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/resource.h>
-#include <sys/select.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <sys/un.h>
#include <time.h>
#include <unistd.h>
-#include <utime.h>
#include <grpc/grpc.h>
#include <grpc/support/log.h>
@@ -905,8 +897,7 @@ static void ActuallyExtractData(const string &argv0,
// timestamp to change between Blaze releases so that the metadata cache
// knows that the files may have changed. This is important for actions that
// use embedded binaries as artifacts.
- struct utimbuf times = { future_time, future_time };
- if (utime(extracted_path, &times) == -1) {
+ if (!blaze_util::SetMtimeMillisec(it, future_time)) {
pdie(blaze_exit_code::LOCAL_ENVIRONMENTAL_ERROR,
"failed to set timestamp on '%s'", extracted_path);
}
@@ -1104,8 +1095,8 @@ static void EnsureCorrectRunningVersion(BlazeServer* server) {
installation_path.c_str());
}
const time_t time_now = time(NULL);
- struct utimbuf times = { time_now, time_now };
- if (utime(globals->options->install_base.c_str(), &times) == -1) {
+ if (!blaze_util::SetMtimeMillisec(globals->options->install_base,
+ time_now)) {
pdie(blaze_exit_code::LOCAL_ENVIRONMENTAL_ERROR,
"failed to set timestamp on '%s'",
globals->options->install_base.c_str());