Changeset 1329


Ignore:
Timestamp:
May 30, 2008, 12:55:46 AM (13 years ago)
Author:
Peter
Message:

Fixed bug with errno. errno is int and taking string+int is not healthy.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/0.4-stable/yat/utility/FileUtil.cc

    r1261 r1329  
    3131#include <iostream>
    3232#include <stdexcept>
     33#include <sstream>
    3334#include <string>
    3435
     
    8788  {
    8889    struct stat statt;
    89     if ( stat(path_.c_str(),&statt) && (errno!=ENOENT) )
    90       throw IO_error(std::string("stat(2) call failed with errno: "+errno));
     90    if ( stat(path_.c_str(),&statt) && (errno!=ENOENT) ) {
     91      std::stringstream ss;
     92      ss << "stat(2) call failed with errno: " << errno;
     93      throw IO_error(ss.str());
     94    }
    9195    if (errno) {
    9296      errno = 0; // don't leave errno in state of failure
Note: See TracChangeset for help on using the changeset viewer.