Commit 6f72305f by Abseil Team Committed by Copybara-Service

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
parent e077941c
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include <string.h> #include <string.h>
#include <cassert> #include <cassert>
#include <cerrno>
#include <cstdint> #include <cstdint>
#include <cstdio> #include <cstdio>
#include <cstdlib> #include <cstdlib>
...@@ -225,8 +226,8 @@ static int64_t ReadMonotonicClockNanos() { ...@@ -225,8 +226,8 @@ static int64_t ReadMonotonicClockNanos() {
int rc = clock_gettime(CLOCK_MONOTONIC, &t); int rc = clock_gettime(CLOCK_MONOTONIC, &t);
#endif #endif
if (rc != 0) { if (rc != 0) {
perror("clock_gettime() failed"); ABSL_INTERNAL_LOG(
abort(); FATAL, "clock_gettime() failed: (" + std::to_string(errno) + ")");
} }
return int64_t{t.tv_sec} * 1000000000 + t.tv_nsec; return int64_t{t.tv_sec} * 1000000000 + t.tv_nsec;
} }
......
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