Changeset 3846 for trunk/test/Suite.cc


Ignore:
Timestamp:
Sep 13, 2019, 2:11:23 PM (2 months ago)
Author:
Peter
Message:

avoid compiler warning about ignoring return value from chdir

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/Suite.cc

    r3439 r3846  
    2727
    2828#include <algorithm>
     29#include <cerrno>
    2930#include <cmath>
    3031#include <cstdlib>
     32#include <cstring>
    3133#include <fstream>
    3234#include <iostream>
     
    5658    std::string test_dir = "test/testSubDir/" + utility::basename(argv[0]);
    5759    utility::mkdir_p(test_dir);
    58     chdir(test_dir.c_str());
     60    if (chdir(test_dir.c_str())) {
     61      err() << "error changing directory: " << test_dir
     62            << strerror(errno) << "\n";
     63      exit (EXIT_HARD_FAILURE);
     64    }
    5965    out() << "running '" << argv[0] << "' in '" << test_dir << "'\n";
    6066    // synchronize cerr and cout, i.e., cout is flushed before
Note: See TracChangeset for help on using the changeset viewer.