Remove g_time1() call

This is not year 2038 compliant on systems with 32-bit integers.

The call can be replaced with the standard C time() call. On
POSIX systems, time_t is guaranteed to be an integer type.
This commit is contained in:
matt335672
2024-12-04 10:12:53 +00:00
parent 54a6bf11d7
commit b02689ab44
6 changed files with 8 additions and 38 deletions
+2 -2
View File
@@ -57,8 +57,8 @@ log_authfail_message(const char *username, const char *ip_addr)
{
ip_addr = "unknown";
}
LOG(LOG_LEVEL_INFO, "AUTHFAIL: user=%s ip=%s time=%d",
username, ip_addr, g_time1());
LOG(LOG_LEVEL_INFO, "AUTHFAIL: user=%s ip=%s time=%ld",
username, ip_addr, (long)time(NULL));
}
/******************************************************************************/
+2 -2
View File
@@ -674,7 +674,7 @@ session_start_wrapped(struct login_info *login_info,
sd->win_mgr = window_manager_pid;
sd->x_server = display_pid;
sd->chansrv = chansrv_pid;
sd->start_time = g_time1();
sd->start_time = time(NULL);
status = E_SCP_SCREATE_OK;
}
}
@@ -860,7 +860,7 @@ session_process_child_exit(struct session_data *sd,
}
else if (pid == sd->win_mgr)
{
int wm_wait_time = g_time1() - sd->start_time;
int wm_wait_time = time(NULL) - sd->start_time;
if (e->reason == E_PXR_STATUS_CODE && e->val == 0)
{