Skip to content

Commit

Permalink
Merge pull request #15915 from opensourcerouting/build-format-suseconds
Browse files Browse the repository at this point in the history
lib, gcc-plugin: fix 64-bit time_t prints
  • Loading branch information
donaldsharp committed May 6, 2024
2 parents af6eecc + da3677e commit 11fe070
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/northbound_oper.c
Original file line number Diff line number Diff line change
Expand Up @@ -1556,8 +1556,9 @@ static enum nb_error nb_op_yield(struct nb_op_yield_state *ys)
unsigned long min_us = MAX(1, NB_OP_WALK_INTERVAL_US / 50000);
struct timeval tv = { .tv_sec = 0, .tv_usec = min_us };

DEBUGD(&nb_dbg_events, "NB oper-state: yielding %s for %lus (should_batch %d)",
ys->xpath, tv.tv_usec, ys->should_batch);
DEBUGD(&nb_dbg_events,
"NB oper-state: yielding %s for %lldus (should_batch %d)",
ys->xpath, (long long)tv.tv_usec, ys->should_batch);

if (ys->should_batch) {
/*
Expand Down
6 changes: 6 additions & 0 deletions tools/gcc-plugins/frr-format.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ static GTY(()) tree local_pid_t_node;
static GTY(()) tree local_uid_t_node;
static GTY(()) tree local_gid_t_node;
static GTY(()) tree local_time_t_node;
static GTY(()) tree local_suseconds_t_node;
static GTY(()) tree local_suseconds64_t_node;

static GTY(()) tree local_socklen_t_node;
static GTY(()) tree local_in_addr_t_node;
Expand All @@ -85,6 +87,8 @@ static struct type_special {
{ &local_uid_t_node, NULL, &local_uid_t_node, },
{ &local_gid_t_node, NULL, &local_gid_t_node, },
{ &local_time_t_node, NULL, &local_time_t_node, },
{ &local_suseconds_t_node, NULL, &local_suseconds_t_node, },
{ &local_suseconds64_t_node, NULL, &local_suseconds64_t_node, },
{ NULL, NULL, NULL, }
};

Expand Down Expand Up @@ -4176,6 +4180,8 @@ handle_finish_parse (void *event_data, void *data)
setup_type ("uid_t", &local_uid_t_node);
setup_type ("gid_t", &local_gid_t_node);
setup_type ("time_t", &local_time_t_node);
setup_type ("__suseconds_t", &local_suseconds_t_node);
setup_type ("__suseconds64_t", &local_suseconds64_t_node);

setup_type ("socklen_t", &local_socklen_t_node);
setup_type ("in_addr_t", &local_in_addr_t_node);
Expand Down

0 comments on commit 11fe070

Please sign in to comment.