Skip to content

Commit

Permalink
Merge pull request rsyslog#5363 from mbiebl/time_t-fixes
Browse files Browse the repository at this point in the history
time_t related fixes
  • Loading branch information
rgerhards authored Apr 12, 2024
2 parents c9016c2 + dbe5cba commit 9725f4c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
7 changes: 4 additions & 3 deletions contrib/mmkubernetes/mmkubernetes.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ static struct cache_s {
struct hashtable *mdHt;
struct hashtable *nsHt;
pthread_mutex_t *cacheMtx;
int lastBusyTime; /* when we got the last busy response from kubernetes */
time_t lastBusyTime; /* when we got the last busy response from kubernetes */
time_t expirationTime; /* if cache expiration checking is enable, time to check for expiration */
} **caches;

Expand Down Expand Up @@ -1722,8 +1722,9 @@ queryKB(wrkrInstanceData_t *pWrkrData, char *url, time_t now, struct json_object
now -= pWrkrData->pData->cache->lastBusyTime;
if (now < pWrkrData->pData->busyRetryInterval) {
LogMsg(0, RS_RET_RETRY, LOG_DEBUG,
"mmkubernetes: Waited [%ld] of [%d] seconds for the requested url [%s]\n",
now, pWrkrData->pData->busyRetryInterval, url);
"mmkubernetes: Waited [%"PRId64"] of [%d] seconds for "
"the requested url [%s]\n",
(int64_t) now, pWrkrData->pData->busyRetryInterval, url);
ABORT_FINALIZE(RS_RET_RETRY);
} else {
LogMsg(0, RS_RET_OK, LOG_DEBUG,
Expand Down
11 changes: 7 additions & 4 deletions plugins/imfile/imfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -857,13 +857,16 @@ detect_updates(fs_edge_t *const edge)
sbool is_file = act->edge->is_file;
if (!is_file || act->time_to_delete + FILE_DELETE_DELAY < ttNow) {
DBGPRINTF("detect_updates obj gone away, unlinking: "
"'%s', ttDelete: %lds, ttNow:%ld isFile: %d\n",
act->name, ttNow - (act->time_to_delete + FILE_DELETE_DELAY), ttNow, is_file);
"'%s', ttDelete: %"PRId64"s, ttNow:%"PRId64" isFile: %d\n",
act->name, (int64_t) ttNow - (act->time_to_delete + FILE_DELETE_DELAY),
(int64_t) ttNow, is_file);
act_obj_unlink(act);
restart = 1;
} else {
DBGPRINTF("detect_updates obj gone away, keep '%s' open: %ld/%ld/%lds!\n",
act->name, act->time_to_delete, ttNow, ttNow - act->time_to_delete);
DBGPRINTF("detect_updates obj gone away, keep '%s' "
"open: %"PRId64"/%"PRId64"/%"PRId64"s!\n",
act->name, (int64_t) act->time_to_delete, (int64_t) ttNow,
(int64_t) ttNow - act->time_to_delete);
pollFile(act);
}
}
Expand Down

0 comments on commit 9725f4c

Please sign in to comment.