From 3ba487ca77dcab94aeb0280a0e175bd1fda75230 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 15 Aug 2011 19:32:30 +0000 Subject: unposted: use pm->node.nam to get names for parameters in errors --- ChangeLog | 7 ++++++- Src/Modules/datetime.c | 10 ++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index e8625ca6e..acbd4c582 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-08-15 Peter Stephenson + + * unposted: Src/Modules/datetime.c: use pm->node.nam to get + parameter names for errors. + 2011-08-14 Mikael Magnusson * 29673: Doc/Zsh/compsys.yo: clarify what 'other' in the @@ -15260,5 +15265,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.5429 $ +* $Revision: 1.5430 $ ***************************************************** diff --git a/Src/Modules/datetime.c b/Src/Modules/datetime.c index 98bcd7d65..a4e7eca86 100644 --- a/Src/Modules/datetime.c +++ b/Src/Modules/datetime.c @@ -152,13 +152,13 @@ getcurrentsecs(UNUSED(Param pm)) } static double -getcurrentrealtime(UNUSED(Param pm)) +getcurrentrealtime(Param pm) { #ifdef HAVE_CLOCK_GETTIME struct timespec now; if (clock_gettime(CLOCK_REALTIME, &now) < 0) { - zwarn("EPOCHREALTIME: unable to retrieve time: %e", errno); + zwarn("%s: unable to retrieve time: %e", pm->node.nam, errno); return (double)0.0; } @@ -167,6 +167,7 @@ getcurrentrealtime(UNUSED(Param pm)) struct timeval now; struct timezone dummy_tz; + (void)pm; gettimeofday(&now, &dummy_tz); return (double)now.tv_sec + (double)now.tv_usec * 1e-6; @@ -174,7 +175,7 @@ getcurrentrealtime(UNUSED(Param pm)) } static char ** -getcurrenttime(UNUSED(Param pm)) +getcurrenttime(Param pm) { char **arr; char buf[DIGBUFSIZE]; @@ -183,7 +184,7 @@ getcurrenttime(UNUSED(Param pm)) struct timespec now; if (clock_gettime(CLOCK_REALTIME, &now) < 0) { - zwarn("EPOCHREALTIME: unable to retrieve time: %e", errno); + zwarn("%s: unable to retrieve time: %e", pm->node.nam, errno); return NULL; } @@ -199,6 +200,7 @@ getcurrenttime(UNUSED(Param pm)) struct timeval now; struct timezone dummy_tz; + (void)pm; gettimeofday(&now, &dummy_tz); arr = (char **)zhalloc(3 * sizeof(*arr)); -- cgit 1.4.1