Ignore:
Timestamp:
Jan 1, 2008, 11:19:57 PM (14 years ago)
Author:
Peter
Message:

reset errno to zero when it is an expected error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/utility/FileUtil.cc

    r1000 r1001  
    7676    if ( stat(path_.c_str(),&statt) && (errno!=ENOENT) )
    7777      throw IO_error(std::string("stat(2) call failed with errno: "+errno));
    78     return !errno;  // 0 if file exists, non-zero if file does not exist
     78    if (errno) {
     79      errno = 0; // don't leave errno in state of failure
     80      return false;
     81    }
     82    return true;
    7983  }
    8084
Note: See TracChangeset for help on using the changeset viewer.