Changeset 896


Ignore:
Timestamp:
Nov 26, 2009, 7:58:34 AM (11 years ago)
Author:
Peter Johansson
Message:

fixes #409

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/svndigest.cc

    r875 r896  
    3939
    4040#include <cassert>
     41#include <cstdlib>
    4142#include <iostream>
    4243#include <fstream>
     
    6364  catch (yat::utility::cmd_error& e) {
    6465    std::cerr << e.what() << std::endl;
    65     exit(-1);
     66    exit(EXIT_FAILURE);
    6667  }
    6768  assert(option);
     
    7576      std::cerr << "\nsvndigest: Cannot open config file "
    7677                << option->config_file() << std::endl;
    77       exit(-1);
     78      exit(EXIT_FAILURE);
    7879    }
    7980    try {
     
    8384      std::cerr << "svndigest: invalid config file\n"
    8485                << e.what() << std::endl;
    85       exit(-1);
     86      exit(EXIT_FAILURE);
    8687    }
    8788    is.close();
     
    9192  if (option->generate_config()) {
    9293    std::cout << config;
    93     exit(0);
     94    exit(EXIT_SUCCESS);
    9495  }
    9596
     
    102103  catch (SVNException e) {
    103104    std::cerr << "svndigest: " << e.what() << "\n";
    104     exit(-1);
     105    exit(EXIT_FAILURE);
    105106  }
    106107
     
    115116      std::cerr << "svndigest: directory `"
    116117                << target_path << "' already exists\n";
    117       exit(-1);
     118      exit(EXIT_FAILURE);
    118119    }
    119120  }
     
    130131              << "\nsvndigest: Failed to determine repository for "
    131132              << option->root() << '\n' << std::endl;
    132     exit(-1);
     133    exit(EXIT_FAILURE);
    133134  }
    134135
     
    145146  catch (NodeException e) {
    146147    std::cerr << "svndigest: " << e.what() << std::endl;
    147     exit(-1);
     148    exit(EXIT_FAILURE);
    148149  }
    149150  assert(tree);
     
    162163      if (node_exist(target_path)) {
    163164        std::cerr << "svndigest: remove failed\n";
    164         exit(-1);
     165        exit(EXIT_FAILURE);
    165166      }
    166167    }
     
    183184    if (chdir(option->targetdir().c_str()) ) {
    184185      std::cerr << "svndigest: chdir " << option->targetdir() << " failed\n";
    185       exit(-1);
     186      exit(EXIT_FAILURE);
    186187    }
    187188    mkdir(tree->name());
    188189    if (chdir(tree->name().c_str()) ) {
    189190      std::cerr << "svndigest: chdir " << tree->name() << " failed\n";
    190       exit(-1);
     191      exit(EXIT_FAILURE);
    191192    }
    192193//    GnuplotFE::instance()->command(std::string("cd '")+option->targetdir()+"/"
     
    203204    catch (const std::runtime_error& x) {
    204205      std::cerr << "svndigest: " << x.what() << std::endl;
    205       exit(-1);
     206      exit(EXIT_FAILURE);
    206207    }
    207208  }
     
    216217    catch (const std::runtime_error& x) {
    217218      std::cerr << "svndigest: " << x.what() << std::endl;
    218       exit(-1);
     219      exit(EXIT_FAILURE);
    219220    }
    220221  }
     
    227228    std::cout << "Done!" << std::endl;
    228229  delete option;
    229   exit(0);        // normal exit
     230  exit(EXIT_SUCCESS);       // normal exit
    230231}
    231232
Note: See TracChangeset for help on using the changeset viewer.