From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: manpage mentions old TIMEFMT
Date: Sat, 14 Apr 2012 21:55:28 +0100 [thread overview]
Message-ID: <20120414215528.2cb405fa@pws-pc.ntlworld.com> (raw)
In-Reply-To: <87lilyz8mn.fsf@gmail.com>
On Sat, 14 Apr 2012 16:32:48 +0200
Christian Neukirchen <chneukirchen@gmail.com> wrote:
> >> Finally, %X and %D are rubbish on Linux (but GNU time(1) always shows
> >> 0 for them).
>
> I'd prefer if they were 0 instead of -9223372036854775808...
I don't know where this is coming from, but the shell does initialise
the structure when it's created, so something in the shell is actually
setting a value --- unless it's the effect of dividing by a zero total
time.
Index: Src/jobs.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/jobs.c,v
retrieving revision 1.88
diff -p -u -r1.88 jobs.c
--- Src/jobs.c 28 Aug 2011 16:38:28 -0000 1.88
+++ Src/jobs.c 14 Apr 2012 20:53:31 -0000
@@ -716,17 +716,22 @@ printtime(struct timeval *real, child_ti
#endif
#ifdef HAVE_STRUCT_RUSAGE_RU_IXRSS
case 'X':
- fprintf(stderr, "%ld", (long)(ti->ru_ixrss / total_time));
+ fprintf(stderr, "%ld",
+ total_time ?
+ (long)(ti->ru_ixrss / total_time) :
+ (long)0);
break;
#endif
#ifdef HAVE_STRUCT_RUSAGE_RU_IDRSS
case 'D':
fprintf(stderr, "%ld",
+ total_time ?
(long) ((ti->ru_idrss
#ifdef HAVE_STRUCT_RUSAGE_RU_ISRSS
+ ti->ru_isrss
#endif
- ) / total_time));
+ ) / total_time) :
+ (long)0);
break;
#endif
#if defined(HAVE_STRUCT_RUSAGE_RU_IDRSS) || \
--
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/
next prev parent reply other threads:[~2012-04-14 20:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-13 20:47 Christian Neukirchen
2012-04-13 21:15 ` Christian Neukirchen
2012-04-13 22:35 ` Peter Stephenson
2012-04-14 14:32 ` Christian Neukirchen
2012-04-14 20:55 ` Peter Stephenson [this message]
2012-04-14 21:17 ` Christian Neukirchen
2012-04-20 11:48 ` Christian Neukirchen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120414215528.2cb405fa@pws-pc.ntlworld.com \
--to=p.w.stephenson@ntlworld.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).