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