Fix time_t complaint when struct timespec doesn't have a time_t seconds value
This commit is contained in:
parent
0bc76f59b9
commit
60fbaab9ce
1 changed files with 2 additions and 1 deletions
3
scp.c
3
scp.c
|
@ -6910,7 +6910,8 @@ if (sim_deb_switches & (SWMASK ('T') | SWMASK ('R') | SWMASK ('A'))) {
|
||||||
sim_timespec_diff (&time_now, &time_now, &sim_deb_basetime);
|
sim_timespec_diff (&time_now, &time_now, &sim_deb_basetime);
|
||||||
}
|
}
|
||||||
if (sim_deb_switches & SWMASK ('T')) {
|
if (sim_deb_switches & SWMASK ('T')) {
|
||||||
struct tm *now = gmtime(&time_now.tv_sec);
|
time_t tnow = (time_t)time_now.tv_sec;
|
||||||
|
struct tm *now = gmtime(&tnow);
|
||||||
|
|
||||||
sprintf(tim_t, "%02d:%02d:%02d.%03d ", now->tm_hour, now->tm_min, now->tm_sec, (int)(time_now.tv_nsec/1000000));
|
sprintf(tim_t, "%02d:%02d:%02d.%03d ", now->tm_hour, now->tm_min, now->tm_sec, (int)(time_now.tv_nsec/1000000));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue