mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2026-02-08 02:36:41 +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 {
|
namespace detail {
|
||||||
|
|
||||||
inline bool calc_wait_time(timespec &ts, std::uint64_t tm /*ms*/) noexcept {
|
inline bool calc_wait_time(timespec &ts, std::uint64_t tm /*ms*/) noexcept {
|
||||||
|
LIBIPC_LOG();
|
||||||
timeval now;
|
timeval now;
|
||||||
int eno = ::gettimeofday(&now, NULL);
|
int eno = ::gettimeofday(&now, NULL);
|
||||||
if (eno != 0) {
|
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) {
|
inline timespec make_timespec(std::uint64_t tm /*ms*/) noexcept(false) {
|
||||||
|
LIBIPC_LOG();
|
||||||
timespec ts {};
|
timespec ts {};
|
||||||
if (!calc_wait_time(ts, tm)) {
|
if (!calc_wait_time(ts, tm)) {
|
||||||
log.error("fail calc_wait_time: tm = ", tm, ", tv_sec = ", ts.tv_sec, ", tv_nsec = ", ts.tv_nsec);
|
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