69ce21
--- crash-trace-command-2.0/trace.c.orig
69ce21
+++ crash-trace-command-2.0/trace.c
69ce21
@@ -15,6 +15,7 @@
69ce21
 #include <stdio.h>
69ce21
 #include <ctype.h>
69ce21
 #include <setjmp.h>
69ce21
+#include <stdlib.h>
69ce21
 
69ce21
 static int verbose = 0;
69ce21
 
69ce21
@@ -892,7 +893,7 @@ out_fail:
69ce21
 
69ce21
 static int ftrace_init_event_type(ulong call, struct event_type *aevent_type)
69ce21
 {
69ce21
-	ulong fields_head;
69ce21
+	ulong fields_head = 0;
69ce21
 
69ce21
 	if (ftrace_get_event_type_fields(call, &fields_head) < 0)
69ce21
 		return -1;
69ce21
@@ -1443,6 +1444,8 @@ static void ftrace_show(int argc, char *
69ce21
 	int fd;
69ce21
 	FILE *file;
69ce21
 	size_t ret;
69ce21
+	size_t nitems __attribute__ ((__unused__));
69ce21
+	char *unused __attribute__ ((__unused__));
69ce21
 
69ce21
 	/* check trace-cmd */
69ce21
 	if (env_trace_cmd)
69ce21
@@ -1465,7 +1468,7 @@ static void ftrace_show(int argc, char *
69ce21
 	}
69ce21
 
69ce21
 	/* dump trace.dat to the temp file */
69ce21
-	mktemp(tmp);
69ce21
+	unused = mktemp(tmp);
69ce21
 	fd = open(tmp, O_WRONLY | O_CREAT | O_TRUNC, 0644);
69ce21
 	if (trace_cmd_data_output(fd) < 0)
69ce21
 		goto out;
69ce21
@@ -1478,7 +1481,7 @@ static void ftrace_show(int argc, char *
69ce21
 		ret = fread(buf, 1, sizeof(buf), file);
69ce21
 		if (ret == 0)
69ce21
 			break;
69ce21
-		fwrite(buf, 1, ret, fp);
69ce21
+		nitems = fwrite(buf, 1, ret, fp);
69ce21
 	}
69ce21
 	pclose(file);
69ce21
 out: