Avoid copying timeval onto stack

This commit is contained in:
Philip Prindeville 2023-08-14 17:52:59 +00:00 committed by Olof Hagsand
parent 4a605ff25e
commit dc0f740a04
5 changed files with 11 additions and 13 deletions

View file

@ -580,7 +580,7 @@ stream_notify(clicon_handle h,
goto done;
}
gettimeofday(&tv, NULL);
if (time2str(tv, timestr, sizeof(timestr)) < 0){
if (time2str(&tv, timestr, sizeof(timestr)) < 0){
clicon_err(OE_UNIX, errno, "time2str");
goto done;
}
@ -645,7 +645,7 @@ stream_notify_xml(clicon_handle h,
goto done;
}
gettimeofday(&tv, NULL);
if (time2str(tv, timestr, sizeof(timestr)) < 0){
if (time2str(&tv, timestr, sizeof(timestr)) < 0){
clicon_err(OE_UNIX, errno, "time2str");
goto done;
}