diff mbox

[3/8] fix warn in intel_reg_snapshot: ignoring return value of 'write'

Message ID 1349874285-31536-4-git-send-email-imre.deak@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Imre Deak Oct. 10, 2012, 1:04 p.m. UTC
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 tools/intel_reg_snapshot.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/tools/intel_reg_snapshot.c b/tools/intel_reg_snapshot.c
index 83e76e5..9c5fa83 100644
--- a/tools/intel_reg_snapshot.c
+++ b/tools/intel_reg_snapshot.c
@@ -25,6 +25,7 @@ 
  */
 
 #include <unistd.h>
+#include <assert.h>
 #include "intel_gpu_tools.h"
 
 int main(int argc, char** argv)
@@ -32,6 +33,7 @@  int main(int argc, char** argv)
 	struct pci_device *pci_dev;
 	uint32_t devid;
 	int mmio_bar;
+	int ret;
 
 	pci_dev = intel_get_pci_device();
 	devid = pci_dev->device_id;
@@ -42,7 +44,8 @@  int main(int argc, char** argv)
 	else
 		mmio_bar = 0;
 
-	write(1, mmio, pci_dev->regions[mmio_bar].size);
+	ret = write(1, mmio, pci_dev->regions[mmio_bar].size);
+	assert(ret > 0);
 
 	return 0;
 }