mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2026-01-01 03:12:13 +08:00
fix(log): add missing LIBIPC_LOG() in posix get_wait_time.h
- Add LIBIPC_LOG() to calc_wait_time() function - Add LIBIPC_LOG() to make_timespec() function - Both functions use log.error() and need the logger initialization
This commit is contained in:
parent
0c4421d5c2
commit
298354973a
@ -14,6 +14,7 @@ namespace posix_ {
|
||||
namespace detail {
|
||||
|
||||
inline bool calc_wait_time(timespec &ts, std::uint64_t tm /*ms*/) noexcept {
|
||||
LIBIPC_LOG();
|
||||
timeval now;
|
||||
int eno = ::gettimeofday(&now, NULL);
|
||||
if (eno != 0) {
|
||||
@ -27,6 +28,7 @@ inline bool calc_wait_time(timespec &ts, std::uint64_t tm /*ms*/) noexcept {
|
||||
}
|
||||
|
||||
inline timespec make_timespec(std::uint64_t tm /*ms*/) noexcept(false) {
|
||||
LIBIPC_LOG();
|
||||
timespec ts {};
|
||||
if (!calc_wait_time(ts, tm)) {
|
||||
log.error("fail calc_wait_time: tm = ", tm, ", tv_sec = ", ts.tv_sec, ", tv_nsec = ", ts.tv_nsec);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user