Merge branch 'mainstream'
[sliver-openvswitch.git] / lib / pcap.c
index afd41fa..1033ba9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2010 Nicira Networks.
+ * Copyright (c) 2009, 2010, 2012 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,7 +16,6 @@
 
 #include <config.h>
 #include "pcap.h"
-#include <assert.h>
 #include <errno.h>
 #include <inttypes.h>
 #include <string.h>
@@ -50,7 +49,7 @@ pcap_open(const char *file_name, const char *mode)
 {
     FILE *file;
 
-    assert(!strcmp(mode, "rb") || !strcmp(mode, "wb"));
+    ovs_assert(!strcmp(mode, "rb") || !strcmp(mode, "wb"));
 
     file = fopen(file_name, mode);
     if (file == NULL) {
@@ -100,7 +99,7 @@ pcap_write_header(FILE *file)
     ph.sigfigs = 0;
     ph.snaplen = 1518;
     ph.network = 1;             /* Ethernet */
-    fwrite(&ph, sizeof ph, 1, file);
+    ignore(fwrite(&ph, sizeof ph, 1, file));
 }
 
 int
@@ -159,6 +158,6 @@ pcap_write(FILE *file, struct ofpbuf *buf)
     prh.ts_usec = 0;
     prh.incl_len = buf->size;
     prh.orig_len = buf->size;
-    fwrite(&prh, sizeof prh, 1, file);
-    fwrite(buf->data, buf->size, 1, file);
+    ignore(fwrite(&prh, sizeof prh, 1, file));
+    ignore(fwrite(buf->data, buf->size, 1, file));
 }