]> Zhao Yanbai Git Server - minix.git/commitdiff
btrace(8): resolve Coverity warnings
authorDavid van Moolenbroek <david@minix3.org>
Fri, 27 Jul 2012 14:44:12 +0000 (14:44 +0000)
committerDavid van Moolenbroek <david@minix3.org>
Mon, 30 Jul 2012 12:10:07 +0000 (12:10 +0000)
commands/btrace/btrace.c

index 1bacf1eb5867486243aa0e9dd9333a30aa557635..dbdf508e933dd7371d149a3e6ea6f2247c253eff 100644 (file)
@@ -9,6 +9,8 @@
 #include <minix/u64.h>
 #include <sys/ioc_block.h>
 
+static btrace_entry buf[BTBUF_SIZE];
+
 static void usage(char *name)
 {
   printf("usage:\n"
@@ -42,7 +44,7 @@ static void btrace_start(char *device, int nr_entries)
        perror("ioctl(BIOCTRACECTL)");
 
        size = 0;
-       ioctl(devfd, BIOCTRACEBUF, &size);
+       (void) ioctl(devfd, BIOCTRACEBUF, &size);
 
        exit(EXIT_FAILURE);
   }
@@ -52,7 +54,6 @@ static void btrace_start(char *device, int nr_entries)
 
 static void btrace_stop(char *device, char *file)
 {
-  btrace_entry buf[BTBUF_SIZE];
   int r, ctl, devfd, outfd;
   size_t size;
 
@@ -163,7 +164,6 @@ static void dump_entry(btrace_entry *entry)
 
 static void btrace_dump(char *file)
 {
-  btrace_entry buf[BTBUF_SIZE];
   int i, r, infd;
 
   if ((infd = open(file, O_RDONLY)) < 0) {