Skip to content

Commit 2b897a4

Browse files
committed
fix build time_t for 32-bits
1 parent 086721f commit 2b897a4

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

src/include/utils/json.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ extern "C"
313313
/* pgpool-II extensions */
314314
json_value *json_get_value_for_key(json_value * source, const char *key);
315315
int json_get_int_value_for_key(json_value * source, const char *key, int *value);
316-
int json_get_long_value_for_key(json_value * source, const char *key, long *value);
316+
int json_get_long_value_for_key(json_value * source, const char *key, time_t *value);
317317
char *json_get_string_value_for_key(json_value * source, const char *key);
318318
int json_get_bool_value_for_key(json_value * source, const char *key, bool *value);
319319

src/include/watchdog/wd_json_data.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ extern bool parse_node_status_json(char *json_data, int data_len, int *nodeID, i
5151

5252

5353
extern bool parse_beacon_message_json(char *json_data, int data_len, int *state,
54-
long *seconds_since_node_startup,
55-
long *seconds_since_current_state,
54+
time_t *seconds_since_node_startup,
55+
time_t *seconds_since_current_state,
5656
int *quorumStatus,
5757
int *standbyNodesCount,
5858
bool *escalated);

src/utils/json.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,7 @@ json_get_int_value_for_key(json_value * source, const char *key, int *value)
11911191
}
11921192

11931193
int
1194-
json_get_long_value_for_key(json_value * source, const char *key, long *value)
1194+
json_get_long_value_for_key(json_value * source, const char *key, time_t *value)
11951195
{
11961196
json_value *jNode;
11971197

src/watchdog/watchdog.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6654,8 +6654,8 @@ watchdog_state_machine_nw_isolation(WD_EVENTS event, WatchdogNode * wdNode, WDPa
66546654
static bool
66556655
beacon_message_received_from_node(WatchdogNode * wdNode, WDPacketData * pkt)
66566656
{
6657-
long seconds_since_node_startup;
6658-
long seconds_since_current_state;
6657+
time_t seconds_since_node_startup;
6658+
time_t seconds_since_current_state;
66596659
int quorum_status;
66606660
int standby_nodes_count;
66616661
bool escalated;

src/watchdog/wd_commands.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ get_wd_runtime_variable_value(char* wd_authkey, char *varName)
193193

194194
case VALUE_DATA_TYPE_LONG:
195195
{
196-
long longVal;
196+
time_t longVal;
197197

198198
if (json_get_long_value_for_key(root, WD_JSON_KEY_VALUE_DATA, &longVal))
199199
{

src/watchdog/wd_json_data.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -540,8 +540,8 @@ get_watchdog_node_from_json(char *json_data, int data_len, char **authkey)
540540
if (json_get_long_value_for_key(root, "StartupTimeSecs", &wdNode->startup_time.tv_sec))
541541
{
542542
bool escalated;
543-
long seconds_since_node_startup;
544-
long seconds_since_current_state;
543+
time_t seconds_since_node_startup;
544+
time_t seconds_since_current_state;
545545
struct timeval current_time;
546546

547547
gettimeofday(&current_time, NULL);
@@ -640,8 +640,8 @@ get_watchdog_node_from_json(char *json_data, int data_len, char **authkey)
640640
bool
641641
parse_beacon_message_json(char *json_data, int data_len,
642642
int *state,
643-
long *seconds_since_node_startup,
644-
long *seconds_since_current_state,
643+
time_t *seconds_since_node_startup,
644+
time_t *seconds_since_current_state,
645645
int *quorumStatus,
646646
int *standbyNodesCount,
647647
bool *escalated)

0 commit comments

Comments
 (0)