Changeset 683 for branches


Ignore:
Timestamp:
Aug 4, 2008, 4:25:09 PM (13 years ago)
Author:
Peter Johansson
Message:

adding code to catch failure from calls to chdir and mkdir et cetera - closes #343

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/0.6-stable/bin/svndigest.cc

    r677 r683  
    155155  if (!option->revisions())
    156156    GnuplotFE::instance()->set_dates(SVNlog(repo).date());
    157   chdir(option->targetdir().c_str());
    158   mkdir(tree->name());
    159   chdir(tree->name().c_str());
     157  if (chdir(option->targetdir().c_str()) ) {
     158    std::cerr << "svndigest: chdir " << option->targetdir() << " failed\n";
     159    exit(-1);
     160  }
     161  if (mkdir(tree->name()) ) {
     162    std::cerr << "svndigest: mkdir " << tree->name() << " failed\n";
     163    exit(-1);
     164  }
     165  if (chdir(tree->name().c_str()) ) {
     166    std::cerr << "svndigest: chdir " << tree->name() << " failed\n";
     167    exit(-1);
     168  }
    160169  GnuplotFE::instance()->command(std::string("cd '")+option->targetdir()+"/"
    161170                                 +tree->name()+"'");
     
    164173  print_main_page(tree->name(), local_log, stats,
    165174                  tree->url());
    166   mkdir("all");
    167   mkdir("images");
     175  if ( mkdir("all") || mkdir("images") ) {
     176    std::cerr << "svndigest: writing output failed\n";
     177    exit(-1);
     178  }
    168179  touch("all/index.html");
    169180  touch("images/index.html");
Note: See TracChangeset for help on using the changeset viewer.