summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2011-08-15 19:32:30 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2011-08-15 19:32:30 +0000
commit3ba487ca77dcab94aeb0280a0e175bd1fda75230 (patch)
tree88e182586de10ac5e84f8b9cf58dd5b5c2782023
parent512660352feb89ae046639a7ebf6d43e888c17d9 (diff)
downloadzsh-3ba487ca77dcab94aeb0280a0e175bd1fda75230.tar.gz
zsh-3ba487ca77dcab94aeb0280a0e175bd1fda75230.zip
unposted: use pm->node.nam to get names for parameters in errors
-rw-r--r--ChangeLog7
-rw-r--r--Src/Modules/datetime.c10
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 <p.w.stephenson@ntlworld.com>
+
+ * unposted: Src/Modules/datetime.c: use pm->node.nam to get
+ parameter names for errors.
+
2011-08-14 Mikael Magnusson <mikachu@gmail.com>
* 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));