diff --git a/diff.cpp b/diff.cpp index 5eb689fb103bb87dc30b920a1ce33ebee35fb9f5..c4558cea2938b4b78445b1c0fda7e11ecf7f918c 100644 --- a/diff.cpp +++ b/diff.cpp @@ -1,6 +1,7 @@ #include <iostream> #include <algorithm> #include <cmath> +#include <cstring> #include "simple/file.hpp" #include "simple/geom/vector.hpp" #include "simple/support/arithmetic.hpp" @@ -71,7 +72,7 @@ void showChange(index_type position, index_type change) std::cout << position[i] << ":" << change[i] << '\n'; } -int main(int argc, char const* argv[]) +int main(int argc, char const* argv[]) try { if(argc <= 2) { @@ -98,3 +99,9 @@ int main(int argc, char const* argv[]) return 0; } +catch(...) +{ + if(errno) + std::cout << "Oh nooo! " << std::strerror(errno) << '\n'; + throw; +} diff --git a/glue.cpp b/glue.cpp index dba6b41b64afbf8dde6c5d9c7633df1e0c960f46..a6bd8ca17305d3ea0873f7aed1955cd5857b237e 100644 --- a/glue.cpp +++ b/glue.cpp @@ -1,4 +1,5 @@ #include <iostream> +#include <cstring> #include "simple/file.hpp" using namespace std; @@ -41,7 +42,7 @@ void process_input() glue(target); } -int main(int argc, char const * argv[]) +int main(int argc, char const * argv[]) try { if(argc < 2) process_input(); @@ -50,3 +51,9 @@ int main(int argc, char const * argv[]) return 0; } +catch(...) +{ + if(errno) + std::cout << "Oh nooo! " << std::strerror(errno) << '\n'; + throw; +} diff --git a/shred.cpp b/shred.cpp index 2a8febb52769d444491f02fc5a52219680892f28..b2e08b1d92fa646d734e1c591e11e12130809327 100644 --- a/shred.cpp +++ b/shred.cpp @@ -5,6 +5,7 @@ #include <map> #include <functional> #include <algorithm> +#include <cstring> #include "simple/file.hpp" #include "simple/support/enum.hpp" @@ -135,7 +136,7 @@ void process_input() } } -int main(int argc, char const * argv[]) +int main(int argc, char const * argv[]) try { process_arguments( {argv, argv + argc} ); if(argc < 2) @@ -143,3 +144,9 @@ int main(int argc, char const * argv[]) return 0; } +catch(...) +{ + if(errno) + std::cout << "Oh nooo! " << std::strerror(errno) << '\n'; + throw; +} diff --git a/swap.cpp b/swap.cpp index 51341c8ad5f5f4ede303fa4bc850f85d1662617d..98c9b298c7f53ad2cb0bde135b17e69835eeb3c0 100644 --- a/swap.cpp +++ b/swap.cpp @@ -1,4 +1,5 @@ #include <iostream> +#include <cstring> #include "simple/file.hpp" using namespace simple; @@ -16,7 +17,7 @@ void swap(const std::string& onePath, const std::string& otherPath) file::bwopex(otherPath) <<= one; } -int main(int argc, char const* argv[]) +int main(int argc, char const* argv[]) try { if(argc < 3) { @@ -31,3 +32,9 @@ int main(int argc, char const* argv[]) return 0; } +catch(...) +{ + if(errno) + std::cout << "Oh nooo! " << std::strerror(errno) << '\n'; + throw; +}