mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-10 12:40:58 +02:00
unposted: use pm->node.nam to get names for parameters in errors
This commit is contained in:
parent
512660352f
commit
3ba487ca77
2 changed files with 12 additions and 5 deletions
|
@ -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>
|
2011-08-14 Mikael Magnusson <mikachu@gmail.com>
|
||||||
|
|
||||||
* 29673: Doc/Zsh/compsys.yo: clarify what 'other' in the
|
* 29673: Doc/Zsh/compsys.yo: clarify what 'other' in the
|
||||||
|
@ -15260,5 +15265,5 @@
|
||||||
|
|
||||||
*****************************************************
|
*****************************************************
|
||||||
* This is used by the shell to define $ZSH_PATCHLEVEL
|
* This is used by the shell to define $ZSH_PATCHLEVEL
|
||||||
* $Revision: 1.5429 $
|
* $Revision: 1.5430 $
|
||||||
*****************************************************
|
*****************************************************
|
||||||
|
|
|
@ -152,13 +152,13 @@ getcurrentsecs(UNUSED(Param pm))
|
||||||
}
|
}
|
||||||
|
|
||||||
static double
|
static double
|
||||||
getcurrentrealtime(UNUSED(Param pm))
|
getcurrentrealtime(Param pm)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_CLOCK_GETTIME
|
#ifdef HAVE_CLOCK_GETTIME
|
||||||
struct timespec now;
|
struct timespec now;
|
||||||
|
|
||||||
if (clock_gettime(CLOCK_REALTIME, &now) < 0) {
|
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;
|
return (double)0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,6 +167,7 @@ getcurrentrealtime(UNUSED(Param pm))
|
||||||
struct timeval now;
|
struct timeval now;
|
||||||
struct timezone dummy_tz;
|
struct timezone dummy_tz;
|
||||||
|
|
||||||
|
(void)pm;
|
||||||
gettimeofday(&now, &dummy_tz);
|
gettimeofday(&now, &dummy_tz);
|
||||||
|
|
||||||
return (double)now.tv_sec + (double)now.tv_usec * 1e-6;
|
return (double)now.tv_sec + (double)now.tv_usec * 1e-6;
|
||||||
|
@ -174,7 +175,7 @@ getcurrentrealtime(UNUSED(Param pm))
|
||||||
}
|
}
|
||||||
|
|
||||||
static char **
|
static char **
|
||||||
getcurrenttime(UNUSED(Param pm))
|
getcurrenttime(Param pm)
|
||||||
{
|
{
|
||||||
char **arr;
|
char **arr;
|
||||||
char buf[DIGBUFSIZE];
|
char buf[DIGBUFSIZE];
|
||||||
|
@ -183,7 +184,7 @@ getcurrenttime(UNUSED(Param pm))
|
||||||
struct timespec now;
|
struct timespec now;
|
||||||
|
|
||||||
if (clock_gettime(CLOCK_REALTIME, &now) < 0) {
|
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;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,6 +200,7 @@ getcurrenttime(UNUSED(Param pm))
|
||||||
struct timeval now;
|
struct timeval now;
|
||||||
struct timezone dummy_tz;
|
struct timezone dummy_tz;
|
||||||
|
|
||||||
|
(void)pm;
|
||||||
gettimeofday(&now, &dummy_tz);
|
gettimeofday(&now, &dummy_tz);
|
||||||
|
|
||||||
arr = (char **)zhalloc(3 * sizeof(*arr));
|
arr = (char **)zhalloc(3 * sizeof(*arr));
|
||||||
|
|
Loading…
Reference in a new issue