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