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