diff options
author | Abseil Team <absl-team@google.com> | 2023-05-31 09:31:34 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-05-31 09:32:32 -0700 |
commit | 6f72305f9514ee341b0c37470749214fa82c37b4 (patch) | |
tree | 56e783ba9deaaa35823a27e6e4cdf7226e7a2e13 /absl | |
parent | e077941c43da6b050101b5af151396053fb251d8 (diff) |
Switch from perror to ABSL_INTERNAL_LOG.
Motivation is for WebAssembly to avoid perror which in turn requires file system emulation.
PiperOrigin-RevId: 536737294
Change-Id: I5177064c9451fb630ec5e9d0c0a0679fabd98afa
Diffstat (limited to 'absl')
-rw-r--r-- | absl/base/internal/sysinfo.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/absl/base/internal/sysinfo.cc b/absl/base/internal/sysinfo.cc index ed203355..7de8ead2 100644 --- a/absl/base/internal/sysinfo.cc +++ b/absl/base/internal/sysinfo.cc @@ -41,6 +41,7 @@ #include <string.h> #include <cassert> +#include <cerrno> #include <cstdint> #include <cstdio> #include <cstdlib> @@ -225,8 +226,8 @@ static int64_t ReadMonotonicClockNanos() { int rc = clock_gettime(CLOCK_MONOTONIC, &t); #endif if (rc != 0) { - perror("clock_gettime() failed"); - abort(); + ABSL_INTERNAL_LOG( + FATAL, "clock_gettime() failed: (" + std::to_string(errno) + ")"); } return int64_t{t.tv_sec} * 1000000000 + t.tv_nsec; } |