dinit-main.cc 659 B

1234567891011121314151617181920212223242526
  1. #include <iostream>
  2. #include <system_error>
  3. #include <new>
  4. // Entry point for Dinit.
  5. int dinit_main(int argc, char **argv);
  6. int main(int argc, char **argv)
  7. {
  8. try {
  9. return dinit_main(argc, argv);
  10. }
  11. catch (std::bad_alloc &badalloc) {
  12. std::cout << "dinit: out-of-memory during initialisation" << std::endl;
  13. return 1;
  14. }
  15. catch (std::system_error &syserr) {
  16. std::cout << "dinit: unexpected system error during initialisation: " << syserr.what() << std::endl;
  17. return 1;
  18. }
  19. catch (...) {
  20. std::cout << "dinit: unexpected error during initialisation" << std::endl;
  21. return 1;
  22. }
  23. }