break down and check return values
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#include "ns3/node-module.h"
|
||||
#include "ns3/core-module.h"
|
||||
#include "ns3/helper-module.h"
|
||||
#include "ns3/abort.h"
|
||||
|
||||
using namespace ns3;
|
||||
using namespace std;
|
||||
@@ -50,7 +51,10 @@ PerfFile (FILE *file, uint32_t n, const char *buffer, uint32_t size)
|
||||
{
|
||||
for (uint32_t i = 0; i < n; ++i)
|
||||
{
|
||||
size_t __attribute__ ((unused)) result = fwrite (buffer, 1, size, file);
|
||||
if (fwrite (buffer, 1, size, file) != size)
|
||||
{
|
||||
NS_ABORT_MSG ("PerfFile(): fwrite error");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
#include "ns3/test.h"
|
||||
#include "ns3/assert.h"
|
||||
#include "ns3/abort.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
@@ -107,7 +108,10 @@ BaseDir (void)
|
||||
// depends on the leading '/'
|
||||
//
|
||||
char pathbuf[PATH_MAX];
|
||||
char * __attribute__ ((unused)) p = getcwd (pathbuf, sizeof(pathbuf));
|
||||
if (getcwd (pathbuf, sizeof(pathbuf)) == NULL)
|
||||
{
|
||||
NS_ABORT_MSG ("Basedir(): unable to getcwd()");
|
||||
}
|
||||
|
||||
//
|
||||
// Walk up the directory tree looking for a directory that has files that
|
||||
|
||||
Reference in New Issue
Block a user