<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
<div class="moz-text-html" lang="zh-CN">
<div class="moz-text-html" lang="zh-CN">
<pre>Hi:
I made minor changes on strace on when allocating memory
failed.
Could you please review it? Thank you very much.
--- count.c 2007-12-07 18:38:18.000000000 +0800
+++ count_new.c 2007-12-07 01:41:53.000000000 +0800
@@ -166,6 +166,12 @@ call_summary_pers(FILE *outf)
char error_str[16];
int *sorted_count = calloc(sizeof(int), nsyscalls);
+ if (!sorted_count)
+ {
+ fprintf(stderr,
+ "strace: out of memory for call sorted_count\n");
+ exit(1);
+ }
call_cum = error_cum = tv_cum.tv_sec = tv_cum.tv_usec = 0;
if (overhead.tv_sec == -1)
Signed-off-by: "Yang Zhiguo" <<a href="mailto:baiwd@cn.fujitsu.com">yzgcsu@cn.fujitsu.com</a>>
Best Regards
</pre>
</div>
</div>
</body>
</html>