about summary refs log tree commit diff
path: root/Src/jobs.c
diff options
context:
space:
mode:
authorJun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>2023-03-30 14:58:07 +0900
committerJun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>2023-03-30 14:58:07 +0900
commitc006d7609703afcfb2162c36d4f745125df45879 (patch)
treec77209443a7ba191ce6976110d5e03639c72cbf3 /Src/jobs.c
parent12e5db145b098a62ff11b88eea26f473ea2ecdcf (diff)
downloadzsh-c006d7609703afcfb2162c36d4f745125df45879.tar.gz
zsh-c006d7609703afcfb2162c36d4f745125df45879.tar.xz
zsh-c006d7609703afcfb2162c36d4f745125df45879.zip
51604: %M in TIMEFMT should report in kilobytes
Diffstat (limited to 'Src/jobs.c')
-rw-r--r--Src/jobs.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/Src/jobs.c b/Src/jobs.c
index 15e2105eb..4d7172550 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -888,8 +888,13 @@ printtime(struct timeval *real, child_times_t *ti, char *desc)
 		break;
 #endif
 #ifdef HAVE_STRUCT_RUSAGE_RU_MAXRSS
+#ifdef RU_MAXRSS_IS_IN_BYTES
+# define MAXRSS_IN_KB(x) ((x)/1024)
+#else
+# define MAXRSS_IN_KB(x) (x)
+#endif
 	    case 'M':
-		fprintf(stderr, "%ld", ti->ru_maxrss / 1024);
+		fprintf(stderr, "%ld", MAXRSS_IN_KB(ti->ru_maxrss));
 		break;
 #endif
 #ifdef HAVE_STRUCT_RUSAGE_RU_MAJFLT
@@ -1036,7 +1041,7 @@ should_report_time(Job j)
 
 #ifdef HAVE_GETRUSAGE
     if (reportmemory >= 0 &&
-	j->procs->ti.ru_maxrss / 1024 > reportmemory)
+	MAXRSS_IN_KB(j->procs->ti.ru_maxrss) > reportmemory)
 	return 1;
 #endif
 
@@ -2646,11 +2651,6 @@ static const struct {
     { "IO", SIGIO },
 #endif
 #endif
-#if defined(SIGABRT) && defined(SIGIOT)
-#if SIGABRT == SIGIOT
-    { "IOT", SIGIOT },
-#endif
-#endif
 #if !defined(SIGERR)
     /*
      * If SIGERR is not defined by the operating system, use it