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