Changeset 1633 for trunk


Ignore:
Timestamp:
Nov 19, 2008, 11:02:10 PM (12 years ago)
Author:
Peter
Message:

do not rely on errno=0 on success

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/fileutil_test.cc

    r1487 r1633  
    3838  test::Suite suite(argc, argv);
    3939  suite.err() << "testing FileUtil ... " << std::endl;
     40
     41  // setting errno just to check that we (on success) do not rely on
     42  // the value of errno
     43  errno = 1;
    4044
    4145  // checking permissions for current directory
  • trunk/yat/utility/FileUtil.cc

    r1628 r1633  
    102102      throw IO_error(ss.str());
    103103    }
    104     if (errno) {
    105       errno = 0; // don't leave errno in state of failure
    106       return false;
    107     }
    108     return true;
     104    return !failed;
    109105  }
    110106
Note: See TracChangeset for help on using the changeset viewer.