diff --git a/AUTHORS b/AUTHORS index 12eba2b5d64da50093fdba05ff55a3a8ebed0830..156cc854e2689df08458ead79f62df9449af3093 100644 --- a/AUTHORS +++ b/AUTHORS @@ -263,6 +263,7 @@ Patches have also been contributed by: Gene Czarcinski Nishank Trivedi Jasper Lievisse Adriaanse + Paul Eggert [....send patches to get your name here....] diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index f0ec742aa90a071d1781b6896ee5b75783252144..3cef7824b8bbc67ddf74daa5c935876c0047ad16 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -3707,7 +3707,7 @@ static char * vshGenFileName(vshControl *ctl, virDomainPtr dom, const char *mime) { char timestr[100]; - struct timeval cur_time; + time_t cur_time; struct tm time_info; const char *ext = NULL; char *ret = NULL; @@ -3723,8 +3723,8 @@ vshGenFileName(vshControl *ctl, virDomainPtr dom, const char *mime) ext = ".png"; /* add mime type here */ - gettimeofday(&cur_time, NULL); - localtime_r(&cur_time.tv_sec, &time_info); + time (&cur_time); + localtime_r(&cur_time, &time_info); strftime(timestr, sizeof(timestr), "%Y-%m-%d-%H:%M:%S", &time_info); if (virAsprintf(&ret, "%s-%s%s", virDomainGetName(dom), diff --git a/tools/virsh.c b/tools/virsh.c index 5cf3237dd371fc073b4a0f651a4fb96f22c808c3..88da4297b2535cefeeb9c552172242eeda28892a 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -2187,7 +2187,7 @@ vshOutputLogFile(vshControl *ctl, int log_level, const char *msg_format, char *str; size_t len; const char *lvl = ""; - struct timeval stTimeval; + time_t stTime; struct tm *stTm; if (ctl->log_fd == -1) @@ -2198,8 +2198,8 @@ vshOutputLogFile(vshControl *ctl, int log_level, const char *msg_format, * * [YYYY.MM.DD HH:MM:SS SIGNATURE PID] LOG_LEVEL message */ - gettimeofday(&stTimeval, NULL); - stTm = localtime(&stTimeval.tv_sec); + time (&stTime); + stTm = localtime(&stTime); virBufferAsprintf(&buf, "[%d.%02d.%02d %02d:%02d:%02d %s %d] ", (1900 + stTm->tm_year), (1 + stTm->tm_mon),